QueryConverter (Solr 3.6.2 API)
Keywords: org.apache.solr.spelling.QueryConverter class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.spelling
Class QueryConverter

    java.lang.Object
      org.apache.solr.spelling.QueryConverter

All Implemented Interfaces:
  NamedListInitializedPlugin

Direct Known Subclasses:
  SpellingQueryConverter

    public abstract class QueryConverter

extends Object
implements NamedListInitializedPlugin

The QueryConverter is an abstract base class defining a method for converting input "raw" queries into a set of tokens for spell checking. It is used to "parse" the CommonParams.Q (the input query) and converts it to tokens.

It is only invoked for the CommonParams.Q parameter, and not the "spellcheck.q" parameter. Systems that use their own query parser or those that find issue with the basic implementation should implement their own QueryConverter instead of using the provided implementation (SpellingQueryConverter) by overriding the appropriate methods on the SpellingQueryConverter and registering it in the solrconfig.xml

Refer to SpellCheckComponent for more details

Since:
  solr 1.3

Field Summary
`protected Analyzer` | `analyzer`

Constructor Summary
`QueryConverter()`

Method Summary
`abstract Collection<Token>` | `convert(String original)`
`Analyzer` | `getAnalyzer()`
`void` | `init(NamedList args)`
`void` | `setAnalyzer(Analyzer analyzer)` Set the analyzer to use.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### analyzer

    protected Analyzer analyzer

Constructor Detail

### QueryConverter

    public QueryConverter()

Method Detail

### init

    public void init(NamedList args)

  Specified by:
    `init` in interface `NamedListInitializedPlugin`

### convert

    public abstract Collection<Token> convert(String original)

  Parameters:
    `original` -
  Returns:
    The Collection of `Token`s for the query. Offsets on the Token should correspond to the correct offset in the origQuery

### setAnalyzer

    public void setAnalyzer(Analyzer analyzer)

  Set the analyzer to use. Must be set before any calls to convert.

  Parameters:
    `analyzer` -

### getAnalyzer

    public Analyzer getAnalyzer()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD