Skip to content

Solr 6 SuggestComponent Compatibility

Compare
Choose a tag to compare
@anthonygroves anthonygroves released this 12 Nov 18:44
· 2 commits to solr6 since this release

Adds functionality to SafariInfixSuggester to best support SuggestComponent suggestions. It covers three main areas where SuggestComponent and the AnalyzingInfixSuggester are lacking:

  1. De-duplication at suggest build time using a HashSet. For some reason, AnalyzingInfixSuggester completely ignores the filterDuplicates config. This HashSet will clear on each suggest build.
  2. Highlighting suggestions. AnalyzingInfixSuggester and SuggestComponent also completely ignores a LookupResult's highlightedKey value, which is where the highlighted suggestion is stored. This replaces the normal key with the highlighted key, which will only exist if the highlight config was set to true.
  3. Handle queries during suggest build gracefully. If a suggest query is sent to the AnalyzingInfixSuggester while suggestions are building, it will throw an error because the searcherMgr object cannot be used during build. SafariInfixSuggester handles this better by just returning 0 suggestions, instead of an error, so that users can still query our multi-suggestion handler and get suggestions from other sources while a specific suggest source is building.
  4. More logging during suggest build and build-lookups.

v1.5.3 - v.1.5.6 were all enhancements to the MultiSuggester classes, which was to support special functionality with SpellCheckComponent suggestions. We have since deprecated our use of SpellCheckComponent in favor of SuggestComponent, and will soon completely remove MultiSuggester classes and related configs.