org.apache.lucene.search.spans
Class SpanQuery

Object
  extended by Query
      extended by SpanQuery
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
SpanChunkedNotQuery, SpanDechunkingQuery, SpanExactQuery, SpanFirstQuery, SpanNearQuery, SpanNotNearQuery, SpanNotQuery, SpanOrNearQuery, SpanOrQuery, SpanRangeQuery, SpanSectionTypeQuery, SpanTermQuery

public abstract class SpanQuery
extends Query

Base class for span-based queries.

See Also:
Serialized Form

Field Summary
private  int spanRecording
           
 
Constructor Summary
SpanQuery()
           
 
Method Summary
protected  Weight createWeight(Searcher searcher)
           
abstract  String getField()
          Returns the name of the field matched by this query.
 int getSpanRecording()
          Retrieve the max number of spans to record for a given document, or zero if span recording is currently off.
abstract  Spans getSpans(IndexReader reader, Searcher searcher)
          Expert: Returns the matches for this query in an index.
abstract  Collection getTerms()
          Returns a collection of all terms matched by this query.
 void setSpanRecording(int n)
          Turn on recording of matching spans, and set the max number of spans to record for a given document.
 
Methods inherited from class Query
clone, combine, extractTerms, getBoost, getSimilarity, mergeBooleanQueries, rewrite, setBoost, toString, toString, weight
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

spanRecording

private int spanRecording
Constructor Detail

SpanQuery

public SpanQuery()
Method Detail

getSpans

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

Throws:
IOException

getField

public abstract String getField()
Returns the name of the field matched by this query.


getTerms

public abstract Collection getTerms()
Returns a collection of all terms matched by this query.


setSpanRecording

public void setSpanRecording(int n)
Turn on recording of matching spans, and set the max number of spans to record for a given document.


getSpanRecording

public int getSpanRecording()
Retrieve the max number of spans to record for a given document, or zero if span recording is currently off.


createWeight

protected Weight createWeight(Searcher searcher)
Overrides:
createWeight in class Query