|
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||
See:
Description
| Interface Summary | |
|---|---|
| Spans | Expert: an enumeration of span matches. |
| Class Summary | |
|---|---|
| EmptySpans | Expert: An empty list of spans, suitable for ORing with other lists. |
| FieldSpans | Keeps a record of the matching spans and search terms for each field. |
| NearSpans | Calculates spans that match several queries "near" each other. |
| OrNearSpans | Calculates spans that match several queries "near" each other. |
| Span | Data holder to keep track of a single matching span. |
| SpanFirstQuery | Matches spans near the beginning of a field. |
| SpanNearQuery | Matches spans which are near one another. |
| SpanNotNearQuery | Removes matches which from one SpanQuery which are too close to spans from another SpanQuery. |
| SpanNotQuery | Removes matches which overlap with another SpanQuery. |
| SpanOrNearQuery | Matches spans which are near one another. |
| SpanOrQuery | Matches the union of its clauses. |
| SpanPosComparator | Comparator on Spans that orders them by ascending start position,
then end position. |
| SpanQuery | Base class for span-based queries. |
| SpanRangeQuery | Matches spans containing terms within a specified range. |
| SpanRecordingScorer | Runs a span query and scores the resulting spans, passing them to a SpanHitCollector if specified. |
| SpanScorer | |
| SpanTermQuery | Matches spans containing a term. |
| SpanWeight | |
| SpanWildcardQuery | Matches spans containing a wildcard term. |
The calculus of spans.
A span is a <doc,startPosition,endPosition> tuple.
The following span query operators are implemented:
q whose end position is less than n. This can be
used to constrain matches to the first part of the document.For example, a span query which matches "John Kerry" within ten words of "George Bush" within the first 100 words of the document could be constructed with:
SpanQuery john = new SpanTermQuery(new Term("content", "john"));
SpanQuery kerry = new SpanTermQuery(new Term("content", "kerry"));
SpanQuery george = new SpanTermQuery(new Term("content", "george"));
SpanQuery bush = new SpanTermQuery(new Term("content", "bush"));
SpanQuery johnKerry =
new SpanNearQuery(new SpanQuery[] {john, kerry}, 0, true);
SpanQuery georgeBush =
new SpanNearQuery(new SpanQuery[] {george, bush}, 0, true);
SpanQuery johnKerryNearGeorgeBush =
new SpanNearQuery(new SpanQuery[] {johnKerry, georgeBush}, 10, false);
SpanQuery johnKerryNearGeorgeBushAtStart =
new SpanFirstQuery(johnKerryNearGeorgeBush, 100);
Span queries may be freely intermixed with other Lucene queries. So, for example, the above query can be restricted to documents which also use the word "iraq" with:
Query query = new BooleanQuery();
query.add(johnKerryNearGeorgeBushAtStart, true, false);
query.add(new TermQuery("content", "iraq"), true, false);
|
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||