I am looking for setting up spellcheck for solr correctly. For performance reason (and avoiding confusion) I don't want to give any suggestion for any query which returns at least one result. Solr provides a parameter spellcheck.maxResultsForSuggest. For my use case i need to set is as 0 as I only want suggestions when no result is returned. However looking into the code of SpellCheckComponent in Solr i saw that for 0 value for spellcheck.maxResultsForSuggest is ignored because of greater than sign. Is there a way i can suppress spell suggestion even if 1 result is returned.
private Integer maxResultsForSuggest(ResponseBuilder rb) { SolrParams params = rb.req.getParams(); float maxResultsForSuggestParamValue = params.getFloat(SpellingParams.SPELLCHECK_MAX_RESULTS_FOR_SUGGEST, 0.0f); Integer maxResultsForSuggest = null; if (maxResultsForSuggestParamValue > 0.0f) { ...} return maxResultsForSuggest }