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:
Cloneable,DistanceSubQuery
public class DistanceQuery extends ComposedQuery implements DistanceSubQuery
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.queryParser.surround.query.SrndQuery
theEmptyLcnQuery
-
-
Constructor Summary
Constructors Constructor Description DistanceQuery(List<SrndQuery> queries, boolean infix, int opDistance, String opName, boolean ordered)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSpanQueries(SpanNearClauseFactory sncf)StringdistanceSubQueryNotAllowed()When distanceSubQueryNotAllowed() returns non null, the reason why the subquery is not allowed as a distance subquery is returned.intgetOpDistance()org.apache.lucene.search.QuerygetSpanNearQuery(org.apache.lucene.index.IndexReader reader, String fieldName, float boost, BasicQueryFactory qf)org.apache.lucene.search.QuerymakeLuceneQueryFieldNoBoost(String fieldName, BasicQueryFactory qf)booleansubQueriesOrdered()-
Methods inherited from class org.apache.lucene.queryParser.surround.query.ComposedQuery
getBracketClose, getBracketOpen, getNrSubQueries, getOperatorName, getPrefixSeparator, getSubQueriesIterator, getSubQuery, infixToString, isFieldsSubQueryAcceptable, isOperatorInfix, makeLuceneSubQueriesField, prefixToString, recompose, toString
-
Methods inherited from class org.apache.lucene.queryParser.surround.query.SrndQuery
clone, getWeight, getWeightOperator, getWeightString, isWeighted, makeLuceneQueryField, setWeight, weightToString
-
-
-
-
Method Detail
-
getOpDistance
public int getOpDistance()
-
subQueriesOrdered
public boolean subQueriesOrdered()
-
distanceSubQueryNotAllowed
public String distanceSubQueryNotAllowed()
Description copied from interface:DistanceSubQueryWhen 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:
distanceSubQueryNotAllowedin interfaceDistanceSubQuery
-
addSpanQueries
public void addSpanQueries(SpanNearClauseFactory sncf) throws IOException
- Specified by:
addSpanQueriesin interfaceDistanceSubQuery- Throws:
IOException
-
makeLuceneQueryFieldNoBoost
public org.apache.lucene.search.Query makeLuceneQueryFieldNoBoost(String fieldName, BasicQueryFactory qf)
- Specified by:
makeLuceneQueryFieldNoBoostin classSrndQuery
-
getSpanNearQuery
public org.apache.lucene.search.Query getSpanNearQuery(org.apache.lucene.index.IndexReader reader, String fieldName, float boost, BasicQueryFactory qf) throws IOException- Throws:
IOException
-
-