Class PayloadTermQuery
java.lang.Object
org.apache.lucene.search.Query
org.apache.lucene.search.spans.SpanQuery
org.apache.lucene.search.spans.SpanTermQuery
org.apache.lucene.search.payloads.PayloadTermQuery
- All Implemented Interfaces:
Cloneable
This class is very similar to
SpanTermQuery except that it factors
in the value of the payload located at each of the positions where the
Term 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.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class org.apache.lucene.search.spans.SpanTermQuery
term -
Constructor Summary
ConstructorsConstructorDescriptionPayloadTermQuery(Term term, PayloadFunction function) PayloadTermQuery(Term term, PayloadFunction function, boolean includeSpanScore) -
Method Summary
Modifier and TypeMethodDescriptioncreateWeight(IndexSearcher searcher) Expert: Constructs an appropriate Weight implementation for this query.booleaninthashCode()Methods inherited from class org.apache.lucene.search.spans.SpanTermQuery
extractTerms, getField, getSpans, getTerm, toString
-
Field Details
-
function
-
-
Constructor Details
-
PayloadTermQuery
-
PayloadTermQuery
-
-
Method Details
-
createWeight
Description copied from class:QueryExpert: Constructs an appropriate Weight implementation for this query.Only implemented by primitive queries, which re-write to themselves.
- Overrides:
createWeightin classSpanQuery- Throws:
IOException
-
hashCode
public int hashCode()- Overrides:
hashCodein classSpanTermQuery
-
equals
- Overrides:
equalsin classSpanTermQuery
-