Spellcheck parameters

As we discussed earlier in this chapter, we do not need to pass any parameter to enable or configure a parameter with a query string. Configuring them with any request handler in the solrconfig.xml file will enable them. Let's understand all our parameters:

Parameter Behavior Default value
spellcheck Enables or disables spellchecking. false
spellcheck.q or spellcheck.q Specifies the query for spellchecking. It will be used if spellcheck.q is specified, or else the original input query will be used.
spellcheck.build Boolean parameter that tells Solr to generate a dictionary if it does not exist. Dictionary building will take additional time in query processing, so it is advisable not to pass this parameter with every request. false
spellcheck.reload A Boolean parameter that tells Solr to reload the spellchecker implementation.
spellcheck.count Specifies the maximum number of suggestions a spellchecker should return in the response for a specific query term. The default value is 1 if the parameter is not set and is 5 if the parameter is set but no value is assigned. 1
spellcheck.onlyMorePopular Specifying this as true will tell Solr to return only those suggestions that have more hits than the original query.
spellcheck.maxResultsForSuggest Specifies a threshold count based on the number of documents matched from the user's original query. For example, if we have set this to 5 and a user's original query returns >= 5 matching documents, Solr will disable the suggestion automatically.
spellcheck.alternativeTermCount Specifies the number of suggestions to be returned from the index and/or dictionary for each query term. It will also enable context-sensitive spelling suggestions.
spellcheck.extendedResults Boolean variable that tells Solr to return additional details about the spellcheck results. For example, setting this to true will return the frequency of the original terms and of suggestions from the index.
spellcheck.collate If true, this parameter tells Solr to create a new query (collation query) from the suggested spelling correction. The collation query can be executed by clicking on the link Did you mean ... ? Returning results is guaranteed, so Solr must execute the collation query in the background before returning results to users.
spellcheck.maxCollations The maximum number of collation queries Solr will generate. The default is 1. It will work only if spellcheck.collate is true. 1
spellcheck.maxCollationTries Specifies the number of times Solr should try for collation before giving up. Specifying a lower value will improve performance as Solr will not provide suggestions in all cases.
spellcheck.maxCollationEvaluations Specifies the maximum number of word correction combinations for evaluating a correct collation that will run against an index. 10000
spellcheck.collateExtendedResults

A boolean value that tells Solr whether to return a response in expanded format or not. Setting this to true will return the response in expanded format. It will work only if spellcheck.collate is true.

false
spellcheck.collateMaxCollectDocs

Specifies the maximum number of documents to be collected for testing of collations against the index. The default value for this parameter is 0, which means that all documents should be collected.

0
spellcheck.collateParam.*Prefix

Used to specify an additional parameter that you want to be considered by the Spellchecker when internally validating collation queries.

spellcheck.dictionary Specifies the dictionary name to be used by Solr for spellchecking. default
spellcheck.accuracy Specifies the accuracy level to decide whether the results provided after spellchecking are sufficient or not. Possible values are float values between 0 and 1. Float.MIN_VALUE
spellcheck.<DICT_NAME>.key Specifies a key/value pair for dictionary implementation of spellcheck.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.164.210