lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neel choudhury <>
Subject Setting Spellcheck for solr only for zero result
Date Sun, 23 Sep 2018 19:58:24 GMT
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 =
    Integer maxResultsForSuggest = null;

    if (maxResultsForSuggestParamValue > 0.0f) {

    return maxResultsForSuggest

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message