public class SpanDechunkingQuery extends SpanQuery
DocNumMap
to find out the mapping
from chunks to the main document. The start and end offsets in each span
are then multiplied by the chunk offset times the non-overlapping word
count per chunk.For instance, say that main document 812 has chunks 813-945. And say that the chunk size is 125 words with an overlap of 25. Spans in chunk 813 will have their offsets unchanged; those in 814 will range from 100-199, those in 815 will range from 200-299, etc.
Warning: The spans that result from this query might not be in strict start/end order. Thus, this query is only suitable as a top-level span query, and never as part of another span query.
Modifier and Type | Field and Description |
---|---|
private DocNumMap |
docNumMap |
private SpanQuery |
wrapped |
Constructor and Description |
---|
SpanDechunkingQuery(SpanQuery wrap)
Construct a query that will mark the results of a normal span query.
|
Modifier and Type | Method and Description |
---|---|
String |
getField()
Returns the name of the field matched by this query.
|
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.
|
SpanQuery |
getWrapped()
Retrieve the SpanQuery being wrapped
|
Query |
rewrite(IndexReader reader) |
void |
setDocNumMap(DocNumMap docNumMap)
Establish a document number map.
|
String |
toString(String field) |
createWeight, getSpanRecording, setSpanRecording
public SpanDechunkingQuery(SpanQuery wrap)
public void setDocNumMap(DocNumMap docNumMap)
public SpanQuery getWrapped()
public String getField()
SpanQuery
public Collection getTerms()
SpanQuery
public Query[] getSubQueries()
public Query rewrite(IndexReader reader) throws IOException
rewrite
in class Query
IOException
public String toString(String field)
toString
in class Query