Package org.apache.lucene.sandbox.search
Class CoveringQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.sandbox.search.CoveringQuery
- All Implemented Interfaces:
Accountable
A
Query that allows to have a configurable number or required matches per document. This
is typically useful in order to build queries whose query terms must all appear in documents.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
ConstructorsConstructorDescriptionCoveringQuery(Collection<Query> queries, LongValuesSource minimumNumberMatch) Sole constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) booleaninthashCode()longrewrite(IndexSearcher indexSearcher) voidvisit(QueryVisitor visitor) Methods inherited from class org.apache.lucene.search.Query
classHash, sameClassAs, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Constructor Details
-
CoveringQuery
Sole constructor.- Parameters:
queries- Sub queries to match.minimumNumberMatch- Per-document long value that records how many queries should match. Values that are less than 1 are treated like1: only documents that have at least one matching clause will be considered matches. Documents that do not have a value forminimumNumberMatchdo not match.
-
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
ramBytesUsed
public long ramBytesUsed()- Specified by:
ramBytesUsedin interfaceAccountable
-
rewrite
- Overrides:
rewritein classQuery- Throws:
IOException
-
visit
-
createWeight
public Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException - Overrides:
createWeightin classQuery- Throws:
IOException
-