|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.solr.handler.RequestHandlerBase
org.apache.solr.handler.SpellCheckerRequestHandler
SpellCheckComponent
instead.
See also https://issues.apache.org/jira/browse/SOLR-474 and https://issues.apache.org/jira/browse/SOLR-485
@Deprecated public class SpellCheckerRequestHandler
Takes a string (e.g. a query string) as the value of the "q" parameter and looks up alternative spelling suggestions in the spellchecker. The spellchecker used by this handler is the Lucene contrib SpellChecker.
The results identifies the original words echoing it as an entry with the name of "words" and original word value. It also identifies if the requested "words" is contained in the index through the use of the exist true/false name value. Examples of these output parameters in the standard output format is as follows:
<str name="words">facial</str> <str name="exist">true</str>
If a query string parameter of "extendedResults" is used, then each word within the "q" parameter (seperated by a space or +) will be iterated through the spell checker and will be wrapped in an NamedList. Each word will then get its own set of results: words, exists, and suggestions.
SpellCheckComponent
for alternatives.
Also note that multiword queries will be treated as a single term if extendedResults is false. This may or may not make sense depending on how the spelling field was indexed.
Examples of the use of the standard ouput (XML) without and with the use of the "extendedResults" parameter are as follows.
The following URL examples were configured with the solr.SpellCheckerRequestHandler named as "/spellchecker".
Without the use of "extendedResults" and one word spelled correctly: facial
http://.../spellchecker?indent=on&onlyMorePopular=true&accuracy=.6&suggestionCount=20&q=facial
<?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">6</int> </lst> <str name="words">facial</str> <str name="exist">true</str> <arr name="suggestions"> <str>faciale</str> <str>faucial</str> <str>fascial</str> <str>facing</str> <str>faciei</str> <str>facialis</str> <str>social</str> <str>facile</str> <str>spacial</str> <str>glacial</str> <str>marcial</str> <str>facies</str> <str>facio</str> </arr> </response>
Without the use of "extendedResults" and two words, one spelled correctly and one misspelled: facial salophosphoprotein
http://.../spellchecker?indent=on&onlyMorePopular=true&accuracy=.6&suggestionCount=20&q=facial+salophosphoprotein
<?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">18</int> </lst> <str name="words">facial salophosphoprotein</str> <str name="exist">false</str> <arr name="suggestions"> <str>sialophosphoprotein</str> </arr> </response>
With the use of "extendedResults" and two words, one spelled correctly and one misspelled: facial salophosphoprotein
http://.../spellchecker?indent=on&onlyMorePopular=true&accuracy=.6&suggestionCount=20&extendedResults=true&q=facial+salophosphoprotein
<?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">23</int> </lst> <lst name="result"> <lst name="facial"> <int name="frequency">1</int> <lst name="suggestions"> <lst name="faciale"><int name="frequency">1</int></lst> <lst name="faucial"><int name="frequency">1</int></lst> <lst name="fascial"><int name="frequency">1</int></lst> <lst name="facing"><int name="frequency">1</int></lst> <lst name="faciei"><int name="frequency">1</int></lst> <lst name="facialis"><int name="frequency">1</int></lst> <lst name="social"><int name="frequency">1</int></lst> <lst name="facile"><int name="frequency">1</int></lst> <lst name="spacial"><int name="frequency">1</int></lst> <lst name="glacial"><int name="frequency">1</int></lst> <lst name="marcial"><int name="frequency">1</int></lst> <lst name="facies"><int name="frequency">1</int></lst> <lst name="facio"><int name="frequency">1</int></lst> </lst> </lst> <lst name="salophosphoprotein"> <int name="frequency">0</int> <lst name="suggestions"> <lst name="sialophosphoprotein"><int name="frequency">1</int></lst> <lst name="phosphoprotein"><int name="frequency">1</int></lst> <lst name="phosphoproteins"><int name="frequency">1</int></lst> <lst name="alphalipoprotein"><int name="frequency">1</int></lst> </lst> </lst> </lst> </response>
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean |
---|
SolrInfoMBean.Category |
Field Summary | |
---|---|
protected static String |
ACCURACY
Deprecated. |
protected SolrParams |
args
Deprecated. |
protected static float |
DEFAULT_ACCURACY
Deprecated. |
protected static float |
DEFAULT_DICTIONARY_THRESHOLD
Deprecated. |
protected static boolean |
DEFAULT_EXTENDED_RESULTS
Deprecated. |
protected static boolean |
DEFAULT_MORE_POPULAR
Deprecated. |
protected static int |
DEFAULT_SUGGESTION_COUNT
Deprecated. |
protected static String |
DICTIONARY_PREFIX
Deprecated. |
protected String |
dirDescription
Deprecated. |
protected static String |
EXTENDED
Deprecated. |
protected static String |
INDEX_DIR
Deprecated. |
protected static String |
POPULAR
Deprecated. |
protected static String |
PREFIX
Deprecated. |
protected static String |
QUERY_PREFIX
Deprecated. |
protected static String |
SOURCE_FIELD
Deprecated. |
protected Directory |
spellcheckerIndexDir
Deprecated. |
protected static String |
SUGGESTIONS
Deprecated. |
protected String |
termSourceField
Deprecated. |
protected static String |
THRESHOLD
Deprecated. |
Fields inherited from class org.apache.solr.handler.RequestHandlerBase |
---|
appends, defaults, httpCaching, initArgs, invariants |
Constructor Summary | |
---|---|
SpellCheckerRequestHandler()
Deprecated. |
Method Summary | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
String |
getDescription()
Deprecated. Simple one or two line description |
||||||||||||||||||||||||||||||
protected Dictionary |
getDictionary(SolrQueryRequest req)
Deprecated. Returns a dictionary to be used when building the spell-checker index. |
||||||||||||||||||||||||||||||
URL[] |
getDocs()
Deprecated. Documentation URL list. |
||||||||||||||||||||||||||||||
String |
getSource()
Deprecated. CVS Source, SVN Source, etc |
||||||||||||||||||||||||||||||
String |
getSourceId()
Deprecated. CVS Id, SVN Id, etc |
||||||||||||||||||||||||||||||
String |
getVersion()
Deprecated. Simple common usage version, e.g. |
||||||||||||||||||||||||||||||
void |
handleRequestBody(SolrQueryRequest req,
SolrQueryResponse rsp)
Deprecated. Processes the following query string parameters: q, extendedResults, cmd rebuild, cmd reopen, accuracy, suggestionCount, restrictToField, and onlyMorePopular. |
||||||||||||||||||||||||||||||
void |
inform(SolrCore core)
Deprecated. |
||||||||||||||||||||||||||||||
void |
init(NamedList args)
Deprecated. Initializes the SolrRequestHandler by creating three SolrParams named:
spellcheckerIndexDirprotected Directory spellcheckerIndexDir
dirDescriptionprotected String dirDescription
termSourceFieldprotected String termSourceField
PREFIXprotected static final String PREFIX
QUERY_PREFIXprotected static final String QUERY_PREFIX
DICTIONARY_PREFIXprotected static final String DICTIONARY_PREFIX
SOURCE_FIELDprotected static final String SOURCE_FIELD
INDEX_DIRprotected static final String INDEX_DIR
THRESHOLDprotected static final String THRESHOLD
ACCURACYprotected static final String ACCURACY
SUGGESTIONSprotected static final String SUGGESTIONS
POPULARprotected static final String POPULAR
EXTENDEDprotected static final String EXTENDED
DEFAULT_ACCURACYprotected static final float DEFAULT_ACCURACY
DEFAULT_SUGGESTION_COUNTprotected static final int DEFAULT_SUGGESTION_COUNT
DEFAULT_MORE_POPULARprotected static final boolean DEFAULT_MORE_POPULAR
DEFAULT_EXTENDED_RESULTSprotected static final boolean DEFAULT_EXTENDED_RESULTS
DEFAULT_DICTIONARY_THRESHOLDprotected static final float DEFAULT_DICTIONARY_THRESHOLD
argsprotected SolrParams args
SpellCheckerRequestHandlerpublic SpellCheckerRequestHandler()
initpublic void init(NamedList args)
informpublic void inform(SolrCore core)
handleRequestBodypublic void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception
getDictionaryprotected Dictionary getDictionary(SolrQueryRequest req)
getVersionpublic String getVersion()
getDescriptionpublic String getDescription()
getSourceIdpublic String getSourceId()
getSourcepublic String getSource()
getDocspublic URL[] getDocs()
Copyright © 2008 Apache Software Foundation. All Rights Reserved. |