Issue
When using Solr’s SuggestComponent in a Fusion query pipeline, requests may intermittently fail with a 500 status error. Log entries typically include the message:
java.lang.IllegalStateException: suggester was not builtThis indicates that Solr was unable to return suggestions because the suggester was not initialized or rebuilt at the time of the query.
Diagnosis
This issue often occurs when:
The suggester is configured with
buildOnCommit="true", causing rebuilds to happen during commits. Queries that arrive while the suggester is rebuilding fail with the error.No
storeDiris configured, which forces the suggester to rebuild from scratch after every Solr node restart.suggest.countis set to a very high number (for example, 500), which increases query load and can worsen failure rates under stress.
Environment
Fusion 4.2.6 SP3
Solr 7.7.3
Note: In Fusion 5.x and later (Kubernetes deployments), SuggestComponent configurations are applied within Solr pods, but the same underlying concepts apply.
Cause
The root cause is that the suggester rebuild process overlaps with active queries, or the suggester does not persist across restarts. As a result, queries may hit a suggester that is unavailable or incomplete.
Resolution
To prevent failures and improve reliability:
Adjust suggester configuration
Update the solrconfig.xml to disable rebuilds on commit and optionally define a persistent store directory:
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">titleMatchSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">suggestions</str>
<str name="suggestAnalyzerFieldType">textSuggest</str>
<str name="contextField">site_s</str>
<str name="exactMatchFirst">false</str>
<str name="buildOnCommit">false</str>
<str name="buildOnStartup">false</str>
<str name="storeDir">suggester_data</str>
</lst>
</searchComponent>Schedule suggester rebuilds
Instead of rebuilding automatically, trigger suggester refreshes through the Solr API on a scheduled basis:
curl "http://<SOLR_HOST>/solr/<COLLECTION>/suggest?suggest.build=true&suggest.dictionary=titleMatchSuggester"This gives administrators control over when rebuilds occur, such as during low-traffic windows.
Optimize performance settings
Reduce
suggest.countfrom large values (such as 500) to a lower number like 20. This reduces system load while still returning useful suggestions.Ensure that the
suggestionsfield is stored in the Solr schema.Verify that the
contextFieldis populated with valid values, otherwise suggestions may not be returned.