Class PayloadNearQuery
This class is very similar to 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 ScorePayload(int, int, int, BytesRef), which returns 1 by default. Payload scores are aggregated using a pluggable PayloadFunction.Inherited Members
Namespace: Lucene.Net.Search.Payloads
Assembly: Lucene.Net.dll
Syntax
public class PayloadNearQuery : SpanNearQuery
Constructors
PayloadNearQuery(SpanQuery[], int, bool)
This class is very similar to 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 ScorePayload(int, int, int, BytesRef), which returns 1 by default. Payload scores are aggregated using a pluggable PayloadFunction.Declaration
public PayloadNearQuery(SpanQuery[] clauses, int slop, bool inOrder)
Parameters
Type | Name | Description |
---|---|---|
SpanQuery[] | clauses | |
int | slop | |
bool | inOrder |
See Also
PayloadNearQuery(SpanQuery[], int, bool, PayloadFunction)
This class is very similar to 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 ScorePayload(int, int, int, BytesRef), which returns 1 by default. Payload scores are aggregated using a pluggable PayloadFunction.Declaration
public PayloadNearQuery(SpanQuery[] clauses, int slop, bool inOrder, PayloadFunction function)
Parameters
Type | Name | Description |
---|---|---|
SpanQuery[] | clauses | |
int | slop | |
bool | inOrder | |
PayloadFunction | function |
See Also
Fields
m_fieldName
This class is very similar to 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 ScorePayload(int, int, int, BytesRef), which returns 1 by default. Payload scores are aggregated using a pluggable PayloadFunction.Declaration
protected string m_fieldName
Field Value
Type | Description |
---|---|
string |
See Also
m_function
This class is very similar to 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 ScorePayload(int, int, int, BytesRef), which returns 1 by default. Payload scores are aggregated using a pluggable PayloadFunction.Declaration
protected PayloadFunction m_function
Field Value
Type | Description |
---|---|
PayloadFunction |
See Also
Methods
Clone()
Returns a clone of this query.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
object |
Overrides
See Also
CreateWeight(IndexSearcher)
Expert: Constructs an appropriate Weight implementation for this query.
Only implemented by primitive queries, which re-write to themselves.Declaration
public override Weight CreateWeight(IndexSearcher searcher)
Parameters
Type | Name | Description |
---|---|---|
IndexSearcher | searcher |
Returns
Type | Description |
---|---|
Weight |
Overrides
See Also
Equals(object)
Returns true iff
o
is equal to this.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj |
Returns
Type | Description |
---|---|
bool |
Overrides
See Also
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |
Overrides
See Also
ToString(string)
Prints a query to a string, with field
assumed to be the
default field and omitted.
Declaration
public override string ToString(string field)
Parameters
Type | Name | Description |
---|---|---|
string | field |
Returns
Type | Description |
---|---|
string |