Solr how to get only the exact match

ぐ巨炮叔叔 提交于 2021-02-11 12:46:35

问题


Sample tags field.

"tags":["[\"Rectangle\",\"Product\",\"Font\",\"Rectangle\",\"Product\",\"Rectangle\",\"Snack\",\"Product\",\"Material property\",\"Product\",\"Material property\"]"],

When I search the keyword land in the tags field I get the results that contain land vehicle

q=tags:land

"tags":["[\"Land vehicle\",\"Vehicle\"]"] - 

I do not want this to produce a match.

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
  <analyzer type="index">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.SynonymGraphFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/>
    <filter class="solr.StopFilterFactory" words="stopwords.txt" igno reCase="true"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>

<field name="tags" type="text_general">

Screenshot of an example document with the tags field as described above

来源:https://stackoverflow.com/questions/66040079/solr-how-to-get-only-the-exact-match

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!