org.cdlib.xtf.textEngine
Class SpanExactQuery

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

public class SpanExactQuery
extends SpanQuery

Just like a SpanNearQuery with slop set to zero, except that it also looks for the special 'start-of-field' and 'end-of-field' tokens inserted by the text indexer. Thus, it will match either the entire field, or none of it.

Author:
Martin Haye
See Also:
Serialized Form

Field Summary
private  SpanQuery[] clauses
           
 
Constructor Summary
SpanExactQuery(SpanQuery[] clauses)
          Construct an exact query on a set of clauses.
 
Method Summary
 SpanQuery[] getClauses()
          Return the clauses whose spans are matched.
 String getField()
          Returns the name of the field matched by this query.
 Spans getSpans(IndexReader reader, Searcher searcher)
          Iterate all the spans from the text query that match the sectionType query also.
 Query[] getSubQueries()
          Return all the sub-queries (clauses in our case)
 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

clauses

private SpanQuery[] clauses
Constructor Detail

SpanExactQuery

public SpanExactQuery(SpanQuery[] clauses)
Construct an exact query on a set of clauses.

Parameters:
clauses - Clauses to match.
Method Detail

rewrite

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

getClauses

public SpanQuery[] getClauses()
Return the clauses whose spans are matched.


getSubQueries

public Query[] getSubQueries()
Return all the sub-queries (clauses in our case)


getSpans

public Spans getSpans(IndexReader reader,
                      Searcher searcher)
               throws IOException
Iterate all the spans from the text query that match the sectionType query also.

Specified by:
getSpans in class SpanQuery
Throws:
IOException

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

toString

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