2014-12-08 68 views
0

如何在春季數據solr展示中搜索多個索引內容? 剛纔我只能搜索「名稱」。例如 如何搜索「companyNo」? 由於事先的索引中的Solr多重搜索索引彈簧數據solr展示

示例XML:這需要搜索

<?xml version="1.0" encoding="UTF-8"?> 
<add> 
    <doc> 
    <field name="id">1051879H_15082014_00003457</field> 
    <field name="name">BEST MEGALINK SDN. BHD.</field> 
    <field name="entityName"></field> 
    <field name="companyNo">1051879-H</field> 
    <field name="noticeType">RMAT_N_C</field> 
    <field name="noticeDate">15/08/2014</field> 
    <field name="repNames"></field> 
    <field name="repNames"></field> 
    <field name="repNames"></field> 
    <field name="repICs"></field> 
    <field name="repICs"></field> 
    <field name="repICs"></field> 
    <field name="format">PDF</field> 
    <field name="folder">15082014</field> 
    <field name="pages">2</field> 
    </doc> 
</add> 

回答

0

等領域,需要添加作爲schema.xml一部分。

例如,需要象下面的字段被添加爲部分schema.xml中:

<field name="entityName" type="text_string" indexed="true" stored="true"/> 
<field name="companyNo" type="text_string" indexed="true" stored="true"/> 
<field name="noticeType" type="text_string" indexed="true" stored="true"/> 
+0

我已經在模式添加。如果我使用http:// localhost:8983/solr /#/或http:// localhost:8983/solr/collection1/browse,我可以輕鬆搜索所有索引的內容。但是當我嘗試使用sping-data-solr-showcase進行搜索時,它無法找到。它只能搜索索引「名稱」。這是我錯過了什麼? – azmilhafiz 2014-12-08 13:47:04