org.cdlib.xtf.textEngine
Class SpellSuggRewriter
Object
QueryRewriter
XtfQueryRewriter
SpellSuggRewriter
public class SpellSuggRewriter
- extends XtfQueryRewriter
Rewrites a Lucene query to replace all misspelled words with their
suggested replacements. We limit the replacements to the specified
set of fields.
- Author:
- Martin Haye
Constructor Summary |
SpellSuggRewriter(Map suggs,
Set fields)
Construct a new rewriter. |
Methods inherited from class QueryRewriter |
combineBoost, copyBoost, copyBoost, forceRewrite, rewrite, rewrite, rewrite, rewrite, rewrite, rewrite, rewrite, rewrite, rewrite, rewriteClauses |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
suggs
private Map suggs
fields
private Set fields
SpellSuggRewriter
public SpellSuggRewriter(Map suggs,
Set fields)
- Construct a new rewriter.
rewrite
protected Query rewrite(SpanExactQuery q)
- Do not rewrite within 'exact' queries
- Overrides:
rewrite
in class XtfQueryRewriter
rewrite
protected Query rewrite(TermQuery q)
- Rewrite a term query. This is only called for artificial queries
introduced by XTF system itself, and therefore we don't map here.
- Overrides:
rewrite
in class QueryRewriter
- Parameters:
q
- The query to rewrite
- Returns:
- Rewritten version, or 'q' unchanged if no changed needed.
rewrite
protected Query rewrite(SpanTermQuery q)
- Rewrite a span term query. Replaces mispelled words
- Overrides:
rewrite
in class QueryRewriter
- Parameters:
q
- The query to rewrite
- Returns:
- Rewritten version, or 'q' unchanged if no changed needed.
rewrite
protected Query rewrite(SpanWildcardQuery q)
- Rewrite a wildcard term query.
- Overrides:
rewrite
in class QueryRewriter
- Parameters:
q
- The query to rewrite
- Returns:
- Rewritten version, or 'q' unchanged if no changed needed.