|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectSimpleQueryRewriter
public abstract class SimpleQueryRewriter
Traverses and rewrites simple Lucene queries. This includes boolean
and phrase queries, but not much else. Very useful for extracting and/or
changing the terms in a query. Usually you derive a class and then
override rewrite(Term)
to do what you need.
If you need to handle other types of queries, derive a class and
provide a rewriteQuery(Query)
method that dispatches to your
custom rewriting methods.
Constructor Summary | |
---|---|
SimpleQueryRewriter()
|
Method Summary | |
---|---|
protected Query |
rewrite(BooleanQuery bq)
Rewrite a BooleanQuery. |
protected Query |
rewrite(PhraseQuery pq)
Rewrite a phrase query. |
protected Term |
rewrite(Term t)
Rewrite a term (e.g. part of a TermQuery or PhraseQuery). |
protected Query |
rewrite(TermQuery q)
Rewrite a term query. |
Query |
rewriteQuery(Query q)
Rewrite a query of any supported type. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleQueryRewriter()
Method Detail |
---|
public Query rewriteQuery(Query q)
q
- Query to rewrite
protected Query rewrite(BooleanQuery bq)
bq
- The query to rewrite
protected Query rewrite(PhraseQuery pq)
pq
- The query to rewrite
protected Query rewrite(TermQuery q)
q
- The query to rewrite
protected Term rewrite(Term t)
t
- The term to rewrite
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |