I migrated the project from Sitecore 8.2 to Sitecore 9.1.1
.
There was a suggester component that we were using to provide a suggestion for a search term. As part of the migration, I also created a new instance of Solr7.2.1
as per the compatibility matrix of Sitecore 9.1.1
.
I copied the exact same configuration from Solr 5.1 to Sitecore7.2.1. I removed one configuration as suggested in the post:
Sitecore 9.1.1 Solr suggester not returning any data
The issue that I have at the moment is results are not matching:
In Solr5.1 return JSON was
{"responseHeader":{"status":0,"QTime":2},"suggest":{"fuzzySuggester":{"water":{"numFound":10,"suggestions":[{"term":"Water checklist","weight":0,"payload":""},{"term":"Water efficiency","weight":0,"payload":""},{"term":"Water efficiency tips","weight":0,"payload":""},{"term":"Water efficient devices","weight":0,"payload":""},{"term":"Water Netserv Plan","weight":0,"payload":""},{"term":"Water pressure issues","weight":0,"payload":""},{"term":"Water quality","weight":0,"payload":""},{"term":"Water quality issues","weight":0,"payload":""},{"term":"Water quality results","weight":0,"payload":""},{"term":"Water quality testing and reports","weight":0,"payload":""}]}},"infixSuggester":{"water":{"numFound":10,"suggestions":[{"term":"<b>Water</b> Netserv Plan","weight":0,"payload":""},{"term":"<b>Water</b> Netserv Plan","weight":0,"payload":""},{"term":"<b>Water</b> Netserv Plan","weight":0,"payload":""},{"term":"<b>Water</b> quality","weight":0,"payload":""},{"term":"<b>Water</b> quality","weight":0,"payload":""},{"term":"<b>Water</b> quality","weight":0,"payload":""},{"term":"<b>Water</b> quality","weight":0,"payload":""},{"term":"<b>Water</b> quality","weight":0,"payload":""},{"term":"<b>Water</b> quality","weight":0,"payload":""},{"term":"<b>Water</b> quality","weight":0,"payload":""}]}}}}
Return JSON in Solr7.2.1:
{
"responseHeader":{
"status":0,
"QTime":4},
"suggest":{
"fuzzySuggester":{
"water":{
"numFound":1,
"suggestions":[{
"term":"water",
"weight":348,
"payload":""}]}},
"infixSuggester":{
"water":{
"numFound":1,
"suggestions":[{
"term":"<b>water</b>",
"weight":348,
"payload":""}]}}}}
As you can see that the search results in 5.1 has more terms and is returning the multiple words in the terms which match the title of pages in Sitecore. Whereas in Solr7.2.1 it is not returning any terms with more than one word.
My current Solr configuration:
Solrconfig.xml
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">fuzzySuggester</str>
<str name="lookupImpl">FuzzyLookupFactory</str>
<str name="storeDir">fuzzy_suggestions</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">_content</str>
<str name="weightField">weight</str>
<str name="suggestAnalyzerFieldType">suggestType</str>
<str name="buildOnStartup">false</str>
<str name="buildOnCommit">false</str>
</lst>
<lst name="suggester">
<str name="name">infixSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="indexPath">infix_suggestions</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">_content</str>
<!--<str name="weightField">weight</str>-->
<str name="suggestAnalyzerFieldType">suggestType</str>
<str name="buildOnStartup">false</str>
<str name="buildOnCommit">false</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler" startup="lazy" >
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.dictionary">infixSuggester</str>
<str name="suggest.dictionary">fuzzySuggester</str>
<str name="suggest.onlyMorePopular">true</str>
<str name="suggest.count">10</str>
<str name="suggest.collate">true</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
My Managed schema:
<fieldtype name="suggestType" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<charFilter class="solr.PatternReplaceCharFilterFactory" pattern="[^a-zA-Z0-9]" replacement=" " />
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldtype>