Class SpanBooleanQueryRewriteWithMaxClause
java.lang.Object
org.apache.lucene.search.MultiTermQuery.RewriteMethod
org.apache.lucene.queries.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod
org.elasticsearch.common.lucene.search.SpanBooleanQueryRewriteWithMaxClause
public class SpanBooleanQueryRewriteWithMaxClause
extends org.apache.lucene.queries.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod
A span rewrite method that extracts the first
maxExpansions
terms
that match the MultiTermQuery
in the terms dictionary.
The rewrite throws an error if more than maxExpansions
terms are found and hardLimit
is set.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
org.apache.lucene.queries.spans.SpanQuery
rewrite
(org.apache.lucene.index.IndexReader reader, org.apache.lucene.search.MultiTermQuery query) Methods inherited from class org.apache.lucene.search.MultiTermQuery.RewriteMethod
getTermsEnum
-
Constructor Details
-
SpanBooleanQueryRewriteWithMaxClause
public SpanBooleanQueryRewriteWithMaxClause() -
SpanBooleanQueryRewriteWithMaxClause
public SpanBooleanQueryRewriteWithMaxClause(int maxExpansions, boolean hardLimit)
-
-
Method Details
-
getMaxExpansions
public int getMaxExpansions() -
isHardLimit
public boolean isHardLimit() -
rewrite
public org.apache.lucene.queries.spans.SpanQuery rewrite(org.apache.lucene.index.IndexReader reader, org.apache.lucene.search.MultiTermQuery query) throws IOException - Specified by:
rewrite
in classorg.apache.lucene.queries.spans.SpanMultiTermQueryWrapper.SpanRewriteMethod
- Throws:
IOException
-