Class SpellcheckOptions
java.lang.Object
org.springframework.data.solr.core.query.SpellcheckOptions
SpellcheckOptions allows modification of query parameters targeting the SpellCheck component is designed to
provide inline query suggestions based on other, similar, terms.- Since:
- 2.1
-
Method Summary
Modifier and TypeMethodDescriptionaccuracy(float nr) Specifies an accuracy value to be used by the spell checking implementation to decide whether a result is worthwhile or not.alternativeTermCount(long nr) The count of suggestions to return for each query term existing in the index and/or dictionary.If set, Solr creates the dictionary that the SolrSpellChecker will use for spell-checking.booleancollate()If set, Solr will take the best suggestion for each token (if one exists) and construct a new query from the suggestions.Instructs Solr to return an expanded response format detailing the collations found.collateParam(String param, Object value) This parameter prefix can be used to specify any additional parameters that you wish to the Spellchecker to use when internally validating collation queries.count(long nr) Specifies the maximum number of spelling suggestions to be returned.dictionaries(String... names) This parameter causes Solr to use the dictionary named in the parameter's argument.Enable the extended response format, which is more complicated but richer.booleanbooleangetCount()String[]booleangetQuery()Get the query to be used for spellchecking.maxCollationCollectDocs(long nr) This parameter specifies the maximum number of documents that should be collect when testing potential collations against the index.maxCollationEvaluations(long evaluations) This parameter specifies the maximum number of word correction combinations to rank and evaluate prior to deciding which collation candidates to test against the index.maxCollations(long max) The maximum number of collations to return.maxCollationTries(long tries) This parameter specifies the number of collation possibilities for Solr to try before giving up.maxResultsForSuggest(long nr) The maximum number of hits the request can return in order to both generate spelling suggestions and set the correctlySpelled element to false.Limits spellcheck responses to queries that are more popular than the original query.static SpellcheckOptionsCreates newSpellcheckOptions.static SpellcheckOptionsspellcheck(Query q) Creates newSpellcheckOptionswith a givenQuery.
-
Method Details
-
spellcheck
Creates newSpellcheckOptions.- Returns:
-
spellcheck
Creates newSpellcheckOptionswith a givenQuery.- Parameters:
q-- Returns:
-
getQuery
Get the query to be used for spellchecking.- Returns:
- can be null.
-
getParams
- Returns:
- never null.
-
buildDictionary
If set, Solr creates the dictionary that the SolrSpellChecker will use for spell-checking.- Returns:
- new
SpellcheckOptions
-
buildDirectory
public boolean buildDirectory()- Returns:
- can be null.
-
collate
If set, Solr will take the best suggestion for each token (if one exists) and construct a new query from the suggestions.- Returns:
- new
SpellcheckOptions
-
getCollate
public boolean getCollate()- Returns:
- can be null.
-
maxCollations
The maximum number of collations to return.- Parameters:
max-- Returns:
-
getMaxCollations
- Returns:
- can be null.
-
maxCollationTries
This parameter specifies the number of collation possibilities for Solr to try before giving up.- Parameters:
tries-- Returns:
-
getMaxCollationTries
- Returns:
- can be null.
-
maxCollationEvaluations
This parameter specifies the maximum number of word correction combinations to rank and evaluate prior to deciding which collation candidates to test against the index.- Parameters:
evaluations-- Returns:
-
getMaxCollationEvaluations
- Returns:
- can be null.
-
extendedResults
Enable the extended response format, which is more complicated but richer. Returns the document frequency for each suggestion and returns one suggestion block for each term in the query string.- Returns:
-
getExtendedResults
- Returns:
- can be null.
-
collateExtendedResults
Instructs Solr to return an expanded response format detailing the collations found.- Returns:
-
getCollateExtendedResults
public boolean getCollateExtendedResults()- Returns:
-
maxCollationCollectDocs
This parameter specifies the maximum number of documents that should be collect when testing potential collations against the index.- Parameters:
nr-- Returns:
-
getMaxCollationCollectDocs
- Returns:
- can be null.
-
collateParam
This parameter prefix can be used to specify any additional parameters that you wish to the Spellchecker to use when internally validating collation queries.- Parameters:
param-value-- Returns:
-
getCollateParams
- Returns:
- can be null.
-
count
Specifies the maximum number of spelling suggestions to be returned.- Parameters:
nr-- Returns:
-
getCount
- Returns:
- can be null.
-
dictionaries
This parameter causes Solr to use the dictionary named in the parameter's argument. The default setting is "default". This parameter can be used to invoke a specific spellchecker on a per request basis.- Returns:
-
getDictionary
- Returns:
- can be null.
-
onlyMorePopular
Limits spellcheck responses to queries that are more popular than the original query.- Returns:
-
getOnlyMorePopular
public boolean getOnlyMorePopular()- Returns:
- never null.
-
maxResultsForSuggest
The maximum number of hits the request can return in order to both generate spelling suggestions and set the correctlySpelled element to false.- Parameters:
nr-- Returns:
-
getMaxResultsForSuggest
- Returns:
- can be null.
-
alternativeTermCount
The count of suggestions to return for each query term existing in the index and/or dictionary.- Parameters:
nr-- Returns:
-
getAlternativeTermCount
- Returns:
- can be null.
-
accuracy
Specifies an accuracy value to be used by the spell checking implementation to decide whether a result is worthwhile or not. The value is a float between 0 and 1.- Parameters:
nr-- Returns:
-
getAccuracy
- Returns:
- can be null.
-