Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by MikeKlaas: http://wiki.apache.org/solr/SpellCheckerRequestHandler The comment on the change is: more spellchecker examples ------------------------------------------------------------------------------ The default termSourceField is 'word'. - == Parameters == + == Core parameters == === q === @@ -61, +61 @@ === qt === This must be set to 'spellchecker' in order to invoke the SpellCheckerRequestHandler + + == Dictionary-related parameters == === termSourceField === @@ -110, +112 @@ The default field is 'word' and can be configured in SolrConfigXml. - == dictionary-related parameters == - === spellcheckerIndexDir === (sp.dictionary.indexDir in <!> ["Solr1.3"]) @@ -122, +122 @@ Determines what terms will be used for creating the dictionary from the source field. The threshold is in terms of ''document frequency'', i.e., what fraction of documents contain this term (not term frequency). This can be used to create a smaller, more accurate dictionary. - The default value is '`0`'. <!> ["Solr1.3"] + The default value is '''`0`'''. <!> ["Solr1.3"] === cmd === @@ -132, +132 @@ If an external process is responsible for building the spell checker index, you must issue '&cmd=reopen' to force the spell checker index directory to be re-opened . - == query-related parameters == + == Query-related parameters == === suggestionCount === @@ -152, +152 @@ When "onlyMorePopular" is set to true and the misspelled word exists in the user field, only words that occur more frequently in the termSourceField than the one given will be returned. The default value is false. - == sp.query.extendedResults == + === sp.query.extendedResults === Whether to use 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. - The default value is '`false`'. <!> ["Solr1.3"] + The default value is '''`false`'''. <!> ["Solr1.3"] == Examples == @@ -173, +173 @@ Return 5 suggestions with a accuracy value of 0.7: http://localhost:8983/solr/select/?q=linix&qt=spellchecker&suggestionCount=5&accuracy=0.7 }}} + + === using extendedResults === + + Query: `q=pithon+programming&extendedResults=true&...` + {{{ + <response> + <lst name="responseHeader"> + <int name="status">0</int> + <int name="QTime">173</int> + </lst> + <lst name="result"> + <lst name="pithon"> + <int name="frequency">5</int> + <lst name="suggestions"> + <lst name="python"> + <int name="frequency">18785</int> + </lst> + </lst> + </lst> + <lst name="progremming"> + <int name="frequency">0</int> + <lst name="suggestions"> + <lst name="programming"> + <int name="frequency">70997</int> + </lst> + <lst name="progressing"> + <int name="frequency">1930</int> + </lst> + <lst name="programing"> + <int name="frequency">597</int> + </lst> + <lst name="progamming"> + <int name="frequency">113</int> + </lst> + <lst name="reprogramming"> + <int name="frequency">344</int> + </lst> + </lst> + </lst> + </lst> + </response> + }}} + + Example of the `extendedResults=true` output in python format: + {{{ + { + 'responseHeader': { + 'status':0, + 'QTime':16 + }, + 'result':{ + 'pithon':{ + 'frequency':5, + 'suggestions':['python',{'frequency':18785}] + }, + 'haus':{ + 'frequency':482, + 'suggestions':['hats',{'frequency':6794},'hans', + {'frequency':5986},'haul',{'frequency':3152},'haas', + {'frequency':1054},'hays',{'frequency':533}] + }, + 'endication':{ + 'frequency':0, + 'suggestions':['indication',{'frequency':9634},'syndication', + {'frequency':17777},'dedication',{'frequency':4470},'medication', + {'frequency':3746},'indications',{'frequency':2783}] + } + } + } + }}} + ---- CategorySolrRequestHandler
