我在 django 中使用 solr。在我的模式中,我有一个字段
<field name="function" type="text" indexed="true" stored="true" multiValued="true" />
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<!-- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" /> -->
<!-- in this example, we will only use synonyms at query time
<filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
-->
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
我有索引值,如婚礼拍摄、婚礼、接待、婚礼前、鸡尾酒、婚礼后、订婚
当我使用 () 时,我想搜索值为“婚礼拍摄”的函数,它为我提供了同时存在“婚礼拍摄”和“婚礼”的值
http://localhost:8983/solr/realwedding/select?q=function%3A(wedding+shoot)&rows=100&fl=function&wt=json&indent=true
如果我使用 "" 它什么也不返回
http://localhost:8983/solr/realwedding/select?q=function%3A%22wedding+shoot%22&rows=100&fl=function&wt=json&indent=true
我想要的是给出与全文“婚礼拍摄”匹配的结果
提前致谢