11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The spellcheck Parameter<br />

This parameter turns on SpellCheck suggestions for the request. If true, then spelling suggestions will be<br />

generated.<br />

The spellcheck.q or q Parameter<br />

This parameter specifies the query to spellcheck. If spellcheck.q is defined, then it is used; otherwise the<br />

original input query is used. The spellcheck.q parameter is intended to be the original query, minus any extra<br />

markup like field names, boosts, and so on. If the q parameter is specified, then the SpellingQueryConverte<br />

r class is used to parse it into tokens; otherwise the WhitespaceTokenizer is used. The choice of which one<br />

to use is up to the application. Essentially, if you have a spelling "ready" version in your application, then it is<br />

probably better to use spellcheck.q. Otherwise, if you just want <strong>Solr</strong> to do the job, use the q parameter.<br />

The SpellingQueryConverter class does not deal properly with non-ASCII characters. In this case, you<br />

have either to use spellcheck.q,<br />

or implement your own QueryConverter.<br />

The spellcheck.build Parameter<br />

If set to true, this parameter creates the dictionary that the <strong>Solr</strong>SpellChecker will use for spell-checking. In a<br />

typical search application, you will need to build the dictionary before using the <strong>Solr</strong>SpellChecker. However, it's<br />

not always necessary to build a dictionary first. For example, you can configure the spellchecker to use a<br />

dictionary that already exists.<br />

The dictionary will take some time to build, so this parameter should not be sent with every request.<br />

The spellcheck.reload Parameter<br />

If set to true, this parameter reloads the spellchecker. The results depend on the implementation of <strong>Solr</strong>SpellC<br />

hecker.reload(). In a typical implementation, reloading the spellchecker means reloading the dictionary.<br />

The spellcheck.count Parameter<br />

This parameter specifies the maximum number of suggestions that the spellchecker should return for a term. If<br />

this parameter isn't set, the value defaults to 1. If the parameter is set but not assigned a number, the value<br />

defaults to 5. If the parameter is set to a positive integer, that number becomes the maximum number of<br />

suggestions returned by the spellchecker.<br />

The spellcheck.onlyMorePopular Parameter<br />

If true, <strong>Solr</strong> will to return suggestions that result in more hits for the query than the existing query. Note that this<br />

will return more popular suggestions even when the given query term is present in the index and considered<br />

"correct".<br />

The spellcheck.maxResultsForSuggest Parameter<br />

For example, if this is set to 5 and the user's query returns 5 or fewer results, the spellchecker will report<br />

"correctlySpelled=false" and also offer suggestions (and collations if requested). Setting this greater than zero is<br />

useful for creating "did-you-mean?" suggestions for queries that return a low number of hits.<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

328

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!