SharePoint 2013 Query Spelling Inclusions for the masses revisited
Query Spelling Suggestions
SharePoint 2013 contains a high-end search engine. Originally based on the FAST technology it has been merged with SharePoint Search providing us with a single, top-of-class search experience.
SharePoint 2013 Search is very powerful and contains advanced language processing tools that try to figure out what it is that you are trying to find. By analyzing your search query it tries to add context to the search phrase what leads to more relevant search results.
When searching we sometimes spell words incorrectly. One of the features of SharePoint 2013 Search are Query Spelling Suggestions that process the words from the search query and control if they are spelled correctly.
It’s not what it seems
For analyzing words from the search query SharePoint 2013 Search can use either a dynamic or a static dictionary. Additionally for certain words you can configure that they should be either always excluded from the list of suggestions or added to it. Those are commonly known as Query Spelling Exclusions and Query Spelling Inclusions.
In my previous article I wrongfully stated that the static dictionary is required to work with query spelling inclusions and exclusions. In reality, which was also confirmed by Igor Veytskin in his comment on my previous article, query spelling inclusions and exclusions work with both the dynamic and static dictionary.
Another thing that I got incorrectly was the fact that you could manage the static dictionary in some way. Unfortunately the static dictionary is fixed and cannot be managed.
When things don’t work
Recently, when researching query spelling suggestions, I noticed, that even though everything was configured correctly, no spelling suggestions were displayed. Having analyzed the ULS log I stumbled upon the following message:
Query spelling correction is disabled (LinguisticComponentsStatus.QuerySpellingEnabled = false)
This message was displayed despite of the fact that Query Spelling in the Linguistic component was enabled. Although I wasn’t able to pinpoint what exactly was causing query spelling suggestions to fail, re-enabling them using the following PowerShell script:
$searchApp = Get-SPEnterpriseSearchServiceApplication Set-SPEnterpriseSearchLinguisticComponentsStatus -SearchApplication $searchApp -QuerySpellingEnabled:$false Set-SPEnterpriseSearchLinguisticComponentsStatus -SearchApplication $searchApp -QuerySpellingEnabled:$true
and resetting the Search Host Controller caused the Query Spelling Suggestions to work correctly as expected.