public class PayloadNearQuery extends SpanNearQuery
SpanNearQuery except that it factors
in the value of the payloads located at each of the positions where the
TermSpans occurs.
In order to take advantage of this, you must override
Similarity.scorePayload(int, java.lang.String, int, int, byte[], int, int)
which returns 1 by default.
Payload scores are aggregated using a pluggable PayloadFunction.| Modifier and Type | Class and Description |
|---|---|
class |
PayloadNearQuery.PayloadNearSpanScorer |
class |
PayloadNearQuery.PayloadNearSpanWeight |
| Modifier and Type | Field and Description |
|---|---|
protected String |
fieldName |
protected PayloadFunction |
function |
clauses, field, inOrder, slop| Constructor and Description |
|---|
PayloadNearQuery(SpanQuery[] clauses,
int slop,
boolean inOrder) |
PayloadNearQuery(SpanQuery[] clauses,
int slop,
boolean inOrder,
PayloadFunction function) |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Returns a clone of this query.
|
Weight |
createWeight(Searcher searcher)
Expert: Constructs an appropriate Weight implementation for this query.
|
boolean |
equals(Object obj)
Returns true iff
o is equal to this. |
int |
hashCode() |
String |
toString(String field)
Prints a query to a string, with
field assumed to be the
default field and omitted. |
extractTerms, getClauses, getField, getSlop, getSpans, isInOrder, rewritecombine, getBoost, getSimilarity, mergeBooleanQueries, setBoost, toString, weightprotected String fieldName
protected PayloadFunction function
public PayloadNearQuery(SpanQuery[] clauses, int slop, boolean inOrder)
public PayloadNearQuery(SpanQuery[] clauses, int slop, boolean inOrder, PayloadFunction function)
public Weight createWeight(Searcher searcher) throws IOException
QueryOnly implemented by primitive queries, which re-write to themselves.
createWeight in class SpanQueryIOExceptionpublic Object clone()
Queryclone in class SpanNearQuerypublic String toString(String field)
Queryfield assumed to be the
default field and omitted.
The representation used is one that is supposed to be readable
by QueryParser. However,
there are the following limitations:
toString in class SpanNearQuerypublic int hashCode()
hashCode in class SpanNearQuerypublic boolean equals(Object obj)
SpanNearQueryo is equal to this.equals in class SpanNearQuery