Package org.apache.lucene.sandbox.search
Class MultiRangeQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.sandbox.search.MultiRangeQuery
- All Implemented Interfaces:
Cloneable
Abstract class for range queries involving multiple ranges against physical points such as
IntPoints
All ranges are logically ORed together- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder for multirange queries.static final class
Representation of a single clause in a MultiRangeQuery -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MultiRangeQuery
(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 Weight
createWeight
(IndexSearcher searcher, ScoreMode scoreMode, float boost) final boolean
int
getField()
int
final int
hashCode()
rewrite
(IndexSearcher indexSearcher) Merges the overlapping ranges and returns unconnected ranges by callingmergeOverlappingRanges(java.util.List<org.apache.lucene.sandbox.search.MultiRangeQuery.RangeClause>, int)
protected abstract String
toString
(int dimension, byte[] value) Returns a string of a single value in a human-readable format for debugging.final String
void
visit
(QueryVisitor visitor) Methods inherited from class org.apache.lucene.search.Query
classHash, rewrite, sameClassAs, toString
-
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
-
rewrite
Merges the overlapping ranges and returns unconnected ranges by callingmergeOverlappingRanges(java.util.List<org.apache.lucene.sandbox.search.MultiRangeQuery.RangeClause>, int)
- Overrides:
rewrite
in classQuery
- Throws:
IOException
-
createWeight
public final Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException - Overrides:
createWeight
in classQuery
- Throws:
IOException
-
getField
-
getNumDims
public int getNumDims() -
getBytesPerDim
public int getBytesPerDim() -
hashCode
public final int hashCode() -
equals
-
toString
-
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
-