1
我修改了techproducts示例以更多地瞭解同義詞。添加的字段有text2_deSolr:同義詞的精確查詢語法?
<fieldType name="text2_de" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.ClassicTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" format="snowball" words="lang/stopwords_de.txt" ignoreCase="true"/>
<filter class="solr.SynonymFilterFactory" expand="true" ignoreCase="true" synonyms="index_synonyms.txt"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.ClassicTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
的index_synonyms.txt由開始的水平分層同義詞擴大了小面的類型根據https://wiki.apache.org/solr/HierarchicalFaceting
aaafoo => aaabar
bbbfoo => bbbfoo bbbbar
cccfoo => cccbar cccbaz
fooaaa,baraaa,bazaaa
Umwelt => 1/HS , 2/HS/Bereich , 3/HS/Bereich/Umwelt
Mensch => 1/HS , 2/HS/Bereich , 3/HS/Bereich/Mensch
...
的加載項的信息顯示,該分析儀工作得非常好並在文件集中找到60x「2/hs/bereich」。
loaded term info for the testfield
我不能做一個Solr的查詢找到這些60份文件。加載的項信息的自動生成的超級鏈接
http://localhost:8983/solr/#/test/query?q=testfield:2%2Fhs%2Fbereich
沒有找到任何匹配(numFound =「0」):
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">0</int>
<lst name="params">
<str name="q">testfield:2/hs/bereich</str>
<str name="indent">on</str>
<str name="wt">xml</str>
<str name="_">1463321610566</str>
</lst>
</lst>
<result name="response" numFound="0" start="0">
</result>
</response>
請給我一個提示,使一個確切的Solr查詢語法同義詞找到這60個文件!