0

I'm using Sitecore 9.1 and SXA 1.8, this the configuration of the SXA suggester :

<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">sxaSuggester</str>
<str name="lookupImpl">BlendedInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="contextField">_language</str>
<str name="field">suggestionadge_s</str>
<str name="suggestAnalyzerFieldType">text_suggester</str>
<str name="payloadField">templatedisplaynameadge_s</str>
<str name="buildOnStartup">true</str>
<str name="buildOnCommit">false</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy" >
<lst name="defaults">
<str name="suggest.dictionary">sxaSuggester</str>
<str name="suggest">true</str>
<str name="suggest.onlyMorePopular">true</str>
<str name="suggest.count">30</str>
<str name="suggest.collate">true</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>  

As I'm using BlendedInfixLookupFactory it should sort the results according to which item that has the searched query closer to the start of the suggestion.

But this is not the case as the below screenshot: enter image description here

As the News Item 1 should be the first one.

4
  • Are you using Solr 7.2.1? Try to set also <str name="weightField">$fieldname$</str> which I think you are missing based on this lucene.apache.org/solr/guide/7_2/… Jun 14, 2019 at 5:46
  • Yes. I'm using Solr 7.2.1, Which field should I use at $fieldname$,suggestionadge_s field which I use at : <str name="field">suggestionadge_s</str> Jun 14, 2019 at 11:05
  • Seems suggestionadge_s makes sense for your setup Jun 14, 2019 at 11:07
  • Please always check suggestions also in the Solr admin panel (you can use admin panel to make a suggestion request). Check what is returned there because I'm pretty sure that you will see the same results there. Jun 14, 2019 at 15:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.