public abstract class TopTermsRewrite<B> extends MultiTermQuery.RewriteMethod
| Constructor and Description |
|---|
TopTermsRewrite(int size)
Create a TopTermsBooleanQueryRewrite for
at most
size terms. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addClause(B topLevel,
Term term,
int docCount,
float boost)
Add a MultiTermQuery term to the top-level query builder.
|
protected abstract void |
addClause(B topLevel,
Term term,
int docCount,
float boost,
TermContext states) |
protected abstract Query |
build(B builder)
Finalize the creation of the query from the builder.
|
boolean |
equals(java.lang.Object obj) |
protected abstract int |
getMaxSize()
return the maximum size of the priority queue (for boolean rewrites this is BooleanQuery#getMaxClauseCount).
|
int |
getSize()
return the maximum priority queue size
|
protected abstract B |
getTopLevelBuilder()
Return a suitable builder for the top-level Query for holding all expanded terms.
|
int |
hashCode() |
Query |
rewrite(IndexReader reader,
MultiTermQuery query) |
getTermsEnumpublic TopTermsRewrite(int size)
size terms.
NOTE: if BooleanQuery.getMaxClauseCount() is smaller than
size, then it will be used instead.
public int getSize()
protected abstract int getMaxSize()
public final Query rewrite(IndexReader reader, MultiTermQuery query) throws java.io.IOException
rewrite in class MultiTermQuery.RewriteMethodjava.io.IOExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectprotected abstract B getTopLevelBuilder()
throws java.io.IOException
java.io.IOExceptionprotected abstract Query build(B builder)
protected final void addClause(B topLevel,
Term term,
int docCount,
float boost)
throws java.io.IOException
java.io.IOExceptionprotected abstract void addClause(B topLevel,
Term term,
int docCount,
float boost,
TermContext states)
throws java.io.IOException
java.io.IOExceptionCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.