org.apache.lucene.search.spans
Class SpanFirstQuery

Object
  extended by Query
      extended by SpanQuery
          extended by SpanFirstQuery
All Implemented Interfaces:
Serializable, Cloneable

public class SpanFirstQuery
extends SpanQuery

Matches spans near the beginning of a field.

See Also:
Serialized Form

Field Summary
private  int end
           
private  SpanQuery match
           
 
Constructor Summary
SpanFirstQuery(SpanQuery match, int end)
          Construct a SpanFirstQuery matching spans in match whose end position is less than or equal to end.
 
Method Summary
 int getEnd()
          Return the maximum end position permitted in a match.
 String getField()
          Returns the name of the field matched by this query.
 SpanQuery getMatch()
          Return the SpanQuery whose matches are filtered.
 Spans getSpans(IndexReader reader, Searcher searcher)
          Expert: Returns the matches for this query in an index.
 Query[] getSubQueries()
           
 Collection getTerms()
          Returns a collection of all terms matched by this query.
 Query rewrite(IndexReader reader)
           
 String toString(String field)
           
 
Methods inherited from class SpanQuery
createWeight, getSpanRecording, setSpanRecording
 
Methods inherited from class Query
clone, combine, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weight
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

match

private SpanQuery match

end

private int end
Constructor Detail

SpanFirstQuery

public SpanFirstQuery(SpanQuery match,
                      int end)
Construct a SpanFirstQuery matching spans in match whose end position is less than or equal to end.

Method Detail

getMatch

public SpanQuery getMatch()
Return the SpanQuery whose matches are filtered.


getEnd

public int getEnd()
Return the maximum end position permitted in a match.


getField

public String getField()
Description copied from class: SpanQuery
Returns the name of the field matched by this query.

Specified by:
getField in class SpanQuery

getTerms

public Collection getTerms()
Description copied from class: SpanQuery
Returns a collection of all terms matched by this query.

Specified by:
getTerms in class SpanQuery

getSubQueries

public Query[] getSubQueries()

rewrite

public Query rewrite(IndexReader reader)
              throws IOException
Overrides:
rewrite in class Query
Throws:
IOException

toString

public String toString(String field)
Specified by:
toString in class Query

getSpans

public Spans getSpans(IndexReader reader,
                      Searcher searcher)
               throws IOException
Description copied from class: SpanQuery
Expert: Returns the matches for this query in an index. Used internally to search for spans.

Specified by:
getSpans in class SpanQuery
Throws:
IOException