Package org.apache.lucene.search
Class MultiRangeQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.MultiRangeQuery
Abstract class for range queries involving multiple ranges against physical points such as
IntPoints
All ranges are logically ORed together
TODO: Add capability for handling overlapping ranges at rewrite time-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for multirange queries.static classRepresentation of a single clause in a MultiRangeQuery -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final int(package private) final String(package private) final int(package private) final List<MultiRangeQuery.RangeClause> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMultiRangeQuery(String field, int numDims, int bytesPerDim, List<MultiRangeQuery.RangeClause> rangeClauses) Expert: create a multidimensional range query with multiple connected ranges -
Method Summary
Modifier and TypeMethodDescriptionfinal WeightcreateWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) Expert: Constructs an appropriate Weight implementation for this query.final booleanOverride and implement query instance equivalence properly in a subclass.private booleanequalsTo(MultiRangeQuery other) intgetField()intfinal inthashCode()Override and implement query hash code properly in a subclass.protected abstract StringtoString(int dimension, byte[] value) Returns a string of a single value in a human-readable format for debugging.final StringPrints a query to a string, withfieldassumed to be the default field and omitted.voidvisit(QueryVisitor visitor) Recurse through the query tree, visiting any child queriesMethods inherited from class org.apache.lucene.search.Query
classHash, rewrite, sameClassAs, toString
-
Field Details
-
field
-
numDims
final int numDims -
bytesPerDim
final int bytesPerDim -
rangeClauses
-
-
Constructor Details
-
MultiRangeQuery
protected MultiRangeQuery(String field, int numDims, int bytesPerDim, List<MultiRangeQuery.RangeClause> rangeClauses) Expert: create a multidimensional range query with multiple connected ranges- Parameters:
field- field name. must not benull.numDims- number of dimensions.rangeClauses- Range Clauses for this query
-
-
Method Details
-
visit
Description copied from class:QueryRecurse through the query tree, visiting any child queries -
createWeight
public final Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException Description copied from class:QueryExpert: Constructs an appropriate Weight implementation for this query.Only implemented by primitive queries, which re-write to themselves.
- Overrides:
createWeightin classQuery- Parameters:
scoreMode- How the produced scorers will be consumed.boost- The boost that is propagated by the parent queries.- Throws:
IOException
-
getField
-
getNumDims
public int getNumDims() -
getBytesPerDim
public int getBytesPerDim() -
hashCode
public final int hashCode()Description copied from class:QueryOverride and implement query hash code properly in a subclass. This is required so thatQueryCacheworks properly. -
equals
Description copied from class:QueryOverride and implement query instance equivalence properly in a subclass. This is required so thatQueryCacheworks properly. Typically a query will be equal to another only if it's an instance of the same class and its document-filtering properties are identical that other instance. Utility methods are provided for certain repetitive code. -
equalsTo
-
toString
Description copied from class:QueryPrints a query to a string, withfieldassumed to be the default field and omitted. -
toString
Returns a string of a single value in a human-readable format for debugging. This is used byQuery.toString().- Parameters:
dimension- dimension of the particular valuevalue- single value, never null- Returns:
- human readable value for debugging
-