java.lang.Object | ||
↳ | org.apache.lucene.search.Query | |
↳ | org.apache.lucene.search.function.CustomScoreQuery |
Query that sets document score as a programmatic function of several (sub) scores:
FieldScoreQuery
getCustomScoreProvider(IndexReader)
.
WARNING: The status of the search.function package is experimental. The APIs introduced here might change in the future and will not be supported anymore in such a case.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a CustomScoreQuery over input subQuery.
| |||||||||||
Create a CustomScoreQuery over input subQuery and a
ValueSourceQuery . | |||||||||||
Create a CustomScoreQuery over input subQuery and a
ValueSourceQuery . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a clone of this query.
| |||||||||||
Expert: Constructs an appropriate Weight implementation for this query.
| |||||||||||
This method is deprecated.
Will be removed in Lucene 3.1.
The doc is relative to the current reader, which is
unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9).
Please override
getCustomScoreProvider(IndexReader) and return a subclass
of CustomScoreProvider for the given IndexReader . | |||||||||||
This method is deprecated.
Will be removed in Lucene 3.1.
The doc is relative to the current reader, which is
unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9).
Please override
getCustomScoreProvider(IndexReader) and return a subclass
of CustomScoreProvider for the given IndexReader . | |||||||||||
This method is deprecated.
Will be removed in Lucene 3.1.
The doc is relative to the current reader, which is
unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9).
Please override
getCustomScoreProvider(IndexReader) and return a subclass
of CustomScoreProvider for the given IndexReader . | |||||||||||
This method is deprecated.
Will be removed in Lucene 3.1.
The doc is relative to the current reader, which is
unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9).
Please override
getCustomScoreProvider(IndexReader) and return a subclass
of CustomScoreProvider for the given IndexReader . | |||||||||||
Returns true if
o is equal to this. | |||||||||||
Expert: adds all terms occurring in this query to the terms set.
| |||||||||||
Returns a hash code value for this object.
| |||||||||||
Checks if this is strict custom scoring.
| |||||||||||
A short name of this query, used in
toString(String) . | |||||||||||
Expert: called to re-write queries into primitive queries.
| |||||||||||
Set the strict mode of this query.
| |||||||||||
Prints a query to a string, with
field assumed to be the
default field and omitted. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a
CustomScoreProvider that calculates the custom scores
for the given IndexReader . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.search.Query
| |||||||||||
From class
java.lang.Object
|
Create a CustomScoreQuery over input subQuery.
subQuery | the sub query whose scored is being customed. Must not be null. |
---|
Create a CustomScoreQuery over input subQuery and a ValueSourceQuery
.
subQuery | the sub query whose score is being customized. Must not be null. |
---|---|
valSrcQuery | a value source query whose scores are used in the custom score
computation. For most simple/convenient use case this would be a
FieldScoreQuery .
This parameter is optional - it can be null.
|
Create a CustomScoreQuery over input subQuery and a ValueSourceQuery
.
subQuery | the sub query whose score is being customized. Must not be null. |
---|---|
valSrcQueries | value source queries whose scores are used in the custom score
computation. For most simple/convenient use case these would be
FieldScoreQueries .
This parameter is optional - it can be null or even an empty array.
|
Expert: Constructs an appropriate Weight implementation for this query.
Only implemented by primitive queries, which re-write to themselves.
IOException |
---|
This method is deprecated.
Will be removed in Lucene 3.1.
The doc is relative to the current reader, which is
unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9).
Please override getCustomScoreProvider(IndexReader)
and return a subclass
of CustomScoreProvider
for the given IndexReader
.
Explain the custom score.
This method is deprecated.
Will be removed in Lucene 3.1.
The doc is relative to the current reader, which is
unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9).
Please override getCustomScoreProvider(IndexReader)
and return a subclass
of CustomScoreProvider
for the given IndexReader
.
Explain the custom score.
This method is deprecated.
Will be removed in Lucene 3.1.
The doc is relative to the current reader, which is
unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9).
Please override getCustomScoreProvider(IndexReader)
and return a subclass
of CustomScoreProvider
for the given IndexReader
.
Compute a custom score by the subQuery score and a number of ValueSourceQuery scores.
This method is deprecated.
Will be removed in Lucene 3.1.
The doc is relative to the current reader, which is
unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9).
Please override getCustomScoreProvider(IndexReader)
and return a subclass
of CustomScoreProvider
for the given IndexReader
.
Compute a custom score by the subQuery score and the ValueSourceQuery score.
Expert: adds all terms occurring in this query to the terms set. Only
works if this query is in its rewritten
form.
Returns a hash code value for this object.
Checks if this is strict custom scoring. In strict custom scoring, the ValueSource part does not participate in weight normalization. This may be useful when one wants full control over how scores are modified, and does not care about normalizing by the ValueSource part. One particular case where this is useful if for testing this query.
Note: only has effect when the ValueSource part is not null.
Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.
IOException |
---|
Prints a query to a string, with field
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:
Returns a CustomScoreProvider
that calculates the custom scores
for the given IndexReader
. The default implementation returns a default
implementation as specified in the docs of CustomScoreProvider
.
IOException |
---|