org.cdlib.xtf.textEngine
Class SpanSectionTypeQuery

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

public class SpanSectionTypeQuery
extends SpanQuery

Supports sectionType filtering of text chunks. Spans from the text query are filtered out if they don't match the sectionType document numbers.

Author:
Martin Haye
See Also:
Serialized Form

Field Summary
private  SpanQuery textQuery
          Text query to filter
private  SpanQuery typeQuery
          Query on the 'sectionType' field, used to limit text query results
 
Constructor Summary
SpanSectionTypeQuery(SpanQuery textQuery, SpanQuery sectionTypeQuery)
          Construct a filtered query.
 
Method Summary
 String getField()
          Returns the name of the field matched by this query.
 SpanQuery getSectionTypeQuery()
           
 Spans getSpans(IndexReader reader, Searcher searcher)
          Iterate all the spans from the text query that match the sectionType query also.
 Collection getTerms()
          Returns a collection of all terms matched by this query.
 SpanQuery getTextQuery()
           
 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

textQuery

private SpanQuery textQuery
Text query to filter


typeQuery

private SpanQuery typeQuery
Query on the 'sectionType' field, used to limit text query results

Constructor Detail

SpanSectionTypeQuery

public SpanSectionTypeQuery(SpanQuery textQuery,
                            SpanQuery sectionTypeQuery)
Construct a filtered query.

Parameters:
textQuery - Text query to filter
sectionTypeQuery - 'sectionType' field query to filter with
Method Detail

getTextQuery

public SpanQuery getTextQuery()

getSectionTypeQuery

public SpanQuery getSectionTypeQuery()

rewrite

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

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