|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectQuery
SpanQuery
SpanDechunkingQuery
public class SpanDechunkingQuery
Wraps a SpanQuery, converting chunk spans to look like they're all part
of the main document. Uses a 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.
Field Summary | |
---|---|
private DocNumMap |
docNumMap
|
private SpanQuery |
wrapped
|
Constructor Summary | |
---|---|
SpanDechunkingQuery(SpanQuery wrap)
Construct a query that will mark the results of a normal span query. |
Method Summary | |
---|---|
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)
|
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 |
---|
private SpanQuery wrapped
private DocNumMap docNumMap
Constructor Detail |
---|
public SpanDechunkingQuery(SpanQuery wrap)
Method Detail |
---|
public void setDocNumMap(DocNumMap docNumMap)
public SpanQuery getWrapped()
public String getField()
SpanQuery
getField
in class SpanQuery
public Collection getTerms()
SpanQuery
getTerms
in class 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
public Spans getSpans(IndexReader reader, Searcher searcher) throws IOException
SpanQuery
getSpans
in class SpanQuery
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |