org.apache.lucene.queryParser.surround.query
Class DistanceQuery

java.lang.Object
  extended by org.apache.lucene.queryParser.surround.query.SrndQuery
      extended by org.apache.lucene.queryParser.surround.query.ComposedQuery
          extended by 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
DistanceQuery(List<SrndQuery> queries, boolean infix, int opDistance, String opName, boolean ordered)
           
 
Method Summary
 void addSpanQueries(SpanNearClauseFactory sncf)
           
 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, String fieldName, float boost, BasicQueryFactory qf)
           
 Query makeLuceneQueryFieldNoBoost(String fieldName, BasicQueryFactory qf)
           
 boolean subQueriesOrdered()
           
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DistanceQuery

public DistanceQuery(List<SrndQuery> queries,
                     boolean infix,
                     int opDistance,
                     String opName,
                     boolean ordered)
Method Detail

getOpDistance

public int getOpDistance()

subQueriesOrdered

public boolean subQueriesOrdered()

distanceSubQueryNotAllowed

public 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 interface DistanceSubQuery

addSpanQueries

public void addSpanQueries(SpanNearClauseFactory sncf)
                    throws IOException
Specified by:
addSpanQueries in interface DistanceSubQuery
Throws:
IOException

makeLuceneQueryFieldNoBoost

public Query makeLuceneQueryFieldNoBoost(String fieldName,
                                         BasicQueryFactory qf)
Specified by:
makeLuceneQueryFieldNoBoost in class SrndQuery

getSpanNearQuery

public Query getSpanNearQuery(IndexReader reader,
                              String fieldName,
                              float boost,
                              BasicQueryFactory qf)
                       throws IOException
Throws:
IOException


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.