问题
I'm using solr Suggester lookupImpl as AnalyzingInfixLookupFactory , it's working fine the only issue i am not able to resolve is the fact I want exact search keyword display on top.
.i.e if I1`q search "Leather bags" then that particular keywords should display on top but it is showing "mens leather", "ladies leather bags" after that it is showing "Leather bags".
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">mySuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">search_keyword</str>
<str name="suggestAnalyzerFieldType">text_general</str>
<str name="buildOnStartup">false</str>
</lst>
</searchComponent>
please help
回答1:
Try by changing the field type for your field suggestAnalyzerFieldType
.
Currently the field suggestAnalyzerFieldType has text_general as the field type for your field.
Use keywordTokenizer
for your field if you are looking for exact matches. As it does not create tokens of the text.
The keywordTokenizer
is : This tokenizer treats the entire text field as a single token.
来源:https://stackoverflow.com/questions/56850084/sorl-suggester-issue