Class DistanceQuery
- java.lang.Object
-
- org.apache.lucene.queryparser.surround.query.SrndQuery
-
- org.apache.lucene.queryparser.surround.query.ComposedQuery
-
- org.apache.lucene.queryparser.surround.query.DistanceQuery
-
- All Implemented Interfaces:
java.lang.Cloneable
,DistanceSubQuery
public class DistanceQuery extends ComposedQuery implements DistanceSubQuery
Factory for NEAR queries
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.queryparser.surround.query.SrndQuery
theEmptyLcnQuery
-
-
Constructor Summary
Constructors Constructor Description DistanceQuery(java.util.List<SrndQuery> queries, boolean infix, int opDistance, java.lang.String opName, boolean ordered)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSpanQueries(SpanNearClauseFactory sncf)
java.lang.String
distanceSubQueryNotAllowed()
When distanceSubQueryNotAllowed() returns non null, the reason why the subquery is not allowed as a distance subquery is returned.int
getOpDistance()
Query
getSpanNearQuery(IndexReader reader, java.lang.String fieldName, float boost, BasicQueryFactory qf)
Query
makeLuceneQueryFieldNoBoost(java.lang.String fieldName, BasicQueryFactory qf)
boolean
subQueriesOrdered()
-
Methods inherited from class org.apache.lucene.queryparser.surround.query.ComposedQuery
getNrSubQueries, getOperatorName, getSubQueriesIterator, getSubQuery, isFieldsSubQueryAcceptable, isOperatorInfix, makeLuceneSubQueriesField, toString
-
Methods inherited from class org.apache.lucene.queryparser.surround.query.SrndQuery
clone, equals, getWeight, getWeightOperator, getWeightString, hashCode, isWeighted, makeLuceneQueryField, setWeight
-
-
-
-
Constructor Detail
-
DistanceQuery
public DistanceQuery(java.util.List<SrndQuery> queries, boolean infix, int opDistance, java.lang.String opName, boolean ordered)
-
-
Method Detail
-
getOpDistance
public int getOpDistance()
-
subQueriesOrdered
public boolean subQueriesOrdered()
-
distanceSubQueryNotAllowed
public java.lang.String distanceSubQueryNotAllowed()
Description copied from interface:DistanceSubQuery
When distanceSubQueryNotAllowed() returns non null, the reason why the subquery is not allowed as a distance subquery is returned.
When distanceSubQueryNotAllowed() returns null addSpanNearQueries() can be used in the creation of the span near clause for the subquery.- Specified by:
distanceSubQueryNotAllowed
in interfaceDistanceSubQuery
-
addSpanQueries
public void addSpanQueries(SpanNearClauseFactory sncf) throws java.io.IOException
- Specified by:
addSpanQueries
in interfaceDistanceSubQuery
- Throws:
java.io.IOException
-
getSpanNearQuery
public Query getSpanNearQuery(IndexReader reader, java.lang.String fieldName, float boost, BasicQueryFactory qf) throws java.io.IOException
- Throws:
java.io.IOException
-
makeLuceneQueryFieldNoBoost
public Query makeLuceneQueryFieldNoBoost(java.lang.String fieldName, BasicQueryFactory qf)
- Specified by:
makeLuceneQueryFieldNoBoost
in classSrndQuery
-
-