Package org.apache.lucene.spatial.prefix
Class ContainsPrefixTreeQuery
- java.lang.Object
-
- org.apache.lucene.search.Query
-
- org.apache.lucene.spatial.prefix.AbstractPrefixTreeQuery
-
- org.apache.lucene.spatial.prefix.ContainsPrefixTreeQuery
-
public class ContainsPrefixTreeQuery extends AbstractPrefixTreeQuery
Finds docs where its indexed shapeCONTAINSthe query shape. For use onRecursivePrefixTreeStrategy.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.spatial.prefix.AbstractPrefixTreeQuery
AbstractPrefixTreeQuery.BaseTermsEnumTraverser
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanmultiOverlappingIndexedShapesIf the spatial data for a document is comprised of multiple overlapping or adjacent parts, it might fail to match a query shape when doing the CONTAINS predicate when the sum of those shapes contain the query shape but none do individually.-
Fields inherited from class org.apache.lucene.spatial.prefix.AbstractPrefixTreeQuery
detailLevel, fieldName, grid, queryShape
-
-
Constructor Summary
Constructors Constructor Description ContainsPrefixTreeQuery(Shape queryShape, String fieldName, SpatialPrefixTree grid, int detailLevel, boolean multiOverlappingIndexedShapes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Override and implement query instance equivalence properly in a subclass.protected DocIdSetgetDocIdSet(LeafReaderContext context)inthashCode()Override and implement query hash code properly in a subclass.StringtoString(String field)Prints a query to a string, withfieldassumed to be the default field and omitted.-
Methods inherited from class org.apache.lucene.spatial.prefix.AbstractPrefixTreeQuery
createWeight, visit
-
Methods inherited from class org.apache.lucene.search.Query
classHash, rewrite, sameClassAs, toString
-
-
-
-
Field Detail
-
multiOverlappingIndexedShapes
protected final boolean multiOverlappingIndexedShapes
If the spatial data for a document is comprised of multiple overlapping or adjacent parts, it might fail to match a query shape when doing the CONTAINS predicate when the sum of those shapes contain the query shape but none do individually. Set this to false to increase performance if you don't care about that circumstance (such as if your indexed data doesn't even have such conditions). See LUCENE-5062.
-
-
Constructor Detail
-
ContainsPrefixTreeQuery
public ContainsPrefixTreeQuery(Shape queryShape, String fieldName, SpatialPrefixTree grid, int detailLevel, boolean multiOverlappingIndexedShapes)
-
-
Method Detail
-
equals
public boolean equals(Object o)
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.- Overrides:
equalsin classAbstractPrefixTreeQuery- See Also:
Query.sameClassAs(Object),Query.classHash()
-
hashCode
public int hashCode()
Description copied from class:QueryOverride and implement query hash code properly in a subclass. This is required so thatQueryCacheworks properly.- Overrides:
hashCodein classAbstractPrefixTreeQuery- See Also:
Query.equals(Object)
-
toString
public String toString(String field)
Description copied from class:QueryPrints a query to a string, withfieldassumed to be the default field and omitted.
-
getDocIdSet
protected DocIdSet getDocIdSet(LeafReaderContext context) throws IOException
- Specified by:
getDocIdSetin classAbstractPrefixTreeQuery- Throws:
IOException
-
-