PayloadScoreQuery to wrap SpanNearQuerypublic 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.
NOTE: In order to take advantage of this with the default scoring implementation
(DefaultSimilarity), you must override DefaultSimilarity.scorePayload(int, int, int, BytesRef),
which returns 1 by default.
Payload scores are aggregated using a pluggable PayloadFunction.
| Modifier and Type | Class and Description |
|---|---|
class |
PayloadNearQuery.PayloadNearSpanScorer
Deprecated.
|
class |
PayloadNearQuery.PayloadNearSpanWeight
Deprecated.
|
SpanNearQuery.Builder, SpanNearQuery.SpanNearWeight| Modifier and Type | Field and Description |
|---|---|
protected String |
fieldName
Deprecated.
|
protected PayloadFunction |
function
Deprecated.
|
clauses, field, inOrder, slop| Constructor and Description |
|---|
PayloadNearQuery(SpanQuery[] clauses,
int slop,
boolean inOrder)
Deprecated.
|
PayloadNearQuery(SpanQuery[] clauses,
int slop,
boolean inOrder,
PayloadFunction function)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
PayloadNearQuery |
clone()
Deprecated.
Returns a clone of this query.
|
SpanWeight |
createWeight(IndexSearcher searcher,
boolean needsScores)
Deprecated.
Create a SpanWeight for this query
|
boolean |
equals(Object obj)
Deprecated.
Returns true iff
o is equal to this. |
int |
hashCode()
Deprecated.
|
String |
toString(String field)
Deprecated.
Prints a query to a string, with
field assumed to be the
default field and omitted. |
getClauses, getField, getSlop, isInOrder, newOrderedNearQuery, newUnorderedNearQuery, rewritegetTermContexts, getTermContextsprotected String fieldName
protected PayloadFunction function
public PayloadNearQuery(SpanQuery[] clauses, int slop, boolean inOrder)
public PayloadNearQuery(SpanQuery[] clauses, int slop, boolean inOrder, PayloadFunction function)
public SpanWeight createWeight(IndexSearcher searcher, boolean needsScores) throws IOException
SpanQuerycreateWeight in class SpanNearQuerysearcher - the IndexSearcher to be searched acrossneedsScores - if the query needs scoresIOException - on errorpublic PayloadNearQuery clone()
Queryclone in class SpanNearQuerypublic String toString(String field)
Queryfield assumed to be the
default field and omitted.toString in class SpanNearQuerypublic int hashCode()
hashCode in class SpanNearQuerypublic boolean equals(Object obj)
SpanNearQueryo is equal to this.equals in class SpanNearQueryCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.