public abstract class AbstractCompoundTermsQuery extends Object implements CompoundTermsQuery
TermQuery
implementations that wrap a group
of TermQuery
sub-queries.Modifier and Type | Class and Description |
---|---|
static class |
AbstractCompoundTermsQuery.CompoundCountsStrategy
Enum describing different ways term counts can be calculated for a compound
terms query.
|
Modifier and Type | Field and Description |
---|---|
protected AbstractCompoundTermsQuery.CompoundCountsStrategy |
countsStrategy |
protected TermsQuery[] |
subQueries
The wrapped wrappedQuery
|
Constructor and Description |
---|
AbstractCompoundTermsQuery(TermsQuery... subQueries) |
Modifier and Type | Method and Description |
---|---|
protected static int |
computeCompoundCount(int[] counts,
AbstractCompoundTermsQuery.CompoundCountsStrategy countsStrategy)
Given an array of counts, compute the output count taking into account the
provided
countsStrategy . |
TermsResultSet |
execute(QueryEngine engine)
Executes each sub-query and then calls
CompoundTermsQuery.combine(TermsResultSet...)
passing the array of TermsResultSet values thus produced. |
AbstractCompoundTermsQuery.CompoundCountsStrategy |
getCountsStrategy()
Gets the current counts strategy.
|
TermsQuery[] |
getSubQueries()
Gets the sub-queries that are part of this compound query.
|
void |
setCountsStrategy(AbstractCompoundTermsQuery.CompoundCountsStrategy countsStrategy)
A compound terms query produces its result set by combining the result sets
from a set of constituent sub-queries.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
combine
protected TermsQuery[] subQueries
protected AbstractCompoundTermsQuery.CompoundCountsStrategy countsStrategy
public AbstractCompoundTermsQuery(TermsQuery... subQueries)
public TermsQuery[] getSubQueries()
CompoundTermsQuery
getSubQueries
in interface CompoundTermsQuery
public final TermsResultSet execute(QueryEngine engine) throws IOException
CompoundTermsQuery.combine(TermsResultSet...)
passing the array of TermsResultSet
values thus produced.
This implementation is marked final, forcing the sub-classes to place
their logic in CompoundTermsQuery.combine(TermsResultSet...)
.execute
in interface TermsQuery
engine
- the QueryEngine
used to execute the search.TermsResultSet
containing the matched terms.IOException
public AbstractCompoundTermsQuery.CompoundCountsStrategy getCountsStrategy()
setCountsStrategy(CompoundCountsStrategy)
for more details.public void setCountsStrategy(AbstractCompoundTermsQuery.CompoundCountsStrategy countsStrategy)
countsStrategy
- the countsStrategy to setprotected static int computeCompoundCount(int[] counts, AbstractCompoundTermsQuery.CompoundCountsStrategy countsStrategy)
countsStrategy
.counts
- an array of count values. Zero and negative values are
ignored (interpreted as count not available).countsStrategy
- the chosen counts strategy.Copyright © 2021 GATE. All rights reserved.