org.apache.lucene.search.spans
Class SpanNotNearQuery

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

public class SpanNotNearQuery
extends SpanQuery

Removes matches which from one SpanQuery which are too close to spans from another SpanQuery.

See Also:
Serialized Form

Field Summary
private  SpanQuery exclude
           
private  SpanQuery include
           
private  int slop
           
 
Constructor Summary
SpanNotNearQuery(SpanQuery include, SpanQuery exclude, int slop)
          Construct a SpanNotQuery matching spans from include which have no overlap with spans from exclude.
 
Method Summary
 SpanQuery getExclude()
          Return the SpanQuery whose matches must not overlap those returned.
 String getField()
          Returns the name of the field matched by this query.
 SpanQuery getInclude()
          Return the SpanQuery whose matches are filtered.
 int getSlop()
          Return the distance that must separate matches from excluded spans.
 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

include

private SpanQuery include

exclude

private SpanQuery exclude

slop

private int slop
Constructor Detail

SpanNotNearQuery

public SpanNotNearQuery(SpanQuery include,
                        SpanQuery exclude,
                        int slop)
Construct a SpanNotQuery matching spans from include which have no overlap with spans from exclude.

Method Detail

getInclude

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


getExclude

public SpanQuery getExclude()
Return the SpanQuery whose matches must not overlap those returned.


getSlop

public int getSlop()
Return the distance that must separate matches from excluded spans.


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