I'm using Solr 7.2.1, I'm trying to implement the 'Did you mean' feature, I've configured the spell check handler and it's working well, the issue is when trying with multiple words, if only one word was spelled correctly, no results are returned. For example if I write 'drive caq', it returns me empty results, if I write 'caq' as a single word, it returns me the correctly spelled word which is 'car'. I want it t return me correctly spelled collations as 'drive car'
Solr Configurations:
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<str name="queryAnalyzerFieldType">text_general</str>
<lst name="spellchecker">
<str name="name">default</str>
<str name="field">title</str>
<str name="classname">solr.DirectSolrSpellChecker</str>
<str name="distanceMeasure">internal</str>
<float name="accuracy">0.5</float>
<int name="maxEdits">2</int>
<int name="minPrefix">1</int>
<int name="maxInspections">5</int>
<int name="minQueryLength">3</int>
<float name="maxQueryFrequency">0.5</float>
</lst>
</searchComponent>
<requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="spellcheck.dictionary">default</str>
<str name="spellcheck">on</str>
<str name="df">title</str>
<str name="spellcheck.extendedResults">true</str>
<str name="spellcheck.count">10</str>
<str name="spellcheck.alternativeTermCount">5</str>
<str name="spellcheck.maxResultsForSuggest">5</str>
<str name="spellcheck.collate">true</str>
<str name="spellcheck.collateExtendedResults">true</str>
<str name="spellcheck.maxCollationTries">10</str>
<str name="spellcheck.maxCollations">5</str>
<str name="spellcheck.build">true</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
the code for using the spell check component:
using (IProviderSearchContext ctx = ContentSearchManager.GetIndex("sitecore_sxa_master_index").CreateSearchContext())
{
var results = ctx.GetSpellCheck(new SolrQuery(Term), new SpellCheckHandlerQueryOptions()
{
SpellCheck = new SpellCheckingParameters()
{
Count = 10,
Build = true,
Collate = true
}
});
}