|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectQuery
SpanQuery
SpanOrNearQuery
public class SpanOrNearQuery
Matches spans which are near one another. Unlike a standard 'near' query, all of the sub-queries need not be present. One can specify slop, the maximum edit distance for those that are present in a given document. If enabled, in-order matches are scored higher than out-of-order.
| Field Summary | |
|---|---|
private SpanQuery[] |
clauses
|
private String |
field
|
private boolean |
penalizeOutOfOrder
|
private int |
slop
|
| Constructor Summary | |
|---|---|
SpanOrNearQuery(SpanQuery[] clauses,
int slop,
boolean penalizeOutOfOrder)
Construct a SpanOrNearQuery. |
|
| Method Summary | |
|---|---|
SpanQuery[] |
getClauses()
Return the clauses whose spans are matched. |
String |
getField()
Returns the name of the field matched by this query. |
int |
getSlop()
Return the maximum number of intervening unmatched positions permitted. |
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. |
boolean |
penalizeOutOfOrder()
Return true if matches are penalized for being out of order. |
Query |
rewrite(IndexReader reader)
|
void |
setSlop(int slop)
Set the maximum edit distance permitted. |
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[] clauses
private int slop
private boolean penalizeOutOfOrder
private String field
| Constructor Detail |
|---|
public SpanOrNearQuery(SpanQuery[] clauses,
int slop,
boolean penalizeOutOfOrder)
slop total edit distance
between them.
When penalizeOutOfOrder is true, out of order clauses are
scored lower than in-order clauses.
| Method Detail |
|---|
public SpanQuery[] getClauses()
public int getSlop()
public boolean penalizeOutOfOrder()
public void setSlop(int slop)
public String getField()
SpanQuery
getField in class SpanQuerypublic Collection getTerms()
SpanQuery
getTerms in class SpanQuerypublic Query[] getSubQueries()
public Query rewrite(IndexReader reader)
throws IOException
rewrite in class QueryIOExceptionpublic String toString(String field)
toString in class Query
public Spans getSpans(IndexReader reader,
Searcher searcher)
throws IOException
SpanQuery
getSpans in class SpanQueryIOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||