|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.search.Query org.apache.lucene.queries.CustomScoreQuery
public class CustomScoreQuery
Query that sets document score as a programmatic function of several (sub) scores:
getCustomScoreProvider(org.apache.lucene.index.AtomicReaderContext)
.
Constructor Summary | |
---|---|
CustomScoreQuery(Query subQuery)
Create a CustomScoreQuery over input subQuery. |
|
CustomScoreQuery(Query subQuery,
Query... scoringQueries)
Create a CustomScoreQuery over input subQuery and a FunctionQuery . |
|
CustomScoreQuery(Query subQuery,
Query scoringQuery)
Create a CustomScoreQuery over input subQuery and a FunctionQuery . |
Method Summary | |
---|---|
CustomScoreQuery |
clone()
|
Weight |
createWeight(IndexSearcher searcher)
|
boolean |
equals(Object o)
Returns true if o is equal to this. |
void |
extractTerms(Set<Term> terms)
|
protected CustomScoreProvider |
getCustomScoreProvider(AtomicReaderContext context)
Returns a CustomScoreProvider that calculates the custom scores
for the given IndexReader . |
int |
hashCode()
Returns a hash code value for this object. |
boolean |
isStrict()
Checks if this is strict custom scoring. |
String |
name()
A short name of this query, used in toString(String) . |
Query |
rewrite(IndexReader reader)
|
void |
setStrict(boolean strict)
Set the strict mode of this query. |
String |
toString(String field)
|
Methods inherited from class org.apache.lucene.search.Query |
---|
getBoost, setBoost, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CustomScoreQuery(Query subQuery)
subQuery
- the sub query whose scored is being customized. Must not be null.public CustomScoreQuery(Query subQuery, Query scoringQuery)
FunctionQuery
.
subQuery
- the sub query whose score is being customized. Must not be null.scoringQuery
- a value source query whose scores are used in the custom score
computation. This parameter is optional - it can be null.public CustomScoreQuery(Query subQuery, Query... scoringQueries)
FunctionQuery
.
subQuery
- the sub query whose score is being customized. Must not be null.scoringQueries
- value source queries whose scores are used in the custom score
computation. This parameter is optional - it can be null or even an empty array.Method Detail |
---|
public Query rewrite(IndexReader reader) throws IOException
rewrite
in class Query
IOException
public void extractTerms(Set<Term> terms)
extractTerms
in class Query
public CustomScoreQuery clone()
clone
in class Query
public String toString(String field)
toString
in class Query
public boolean equals(Object o)
o
is equal to this.
equals
in class Query
public int hashCode()
hashCode
in class Query
protected CustomScoreProvider getCustomScoreProvider(AtomicReaderContext context) throws IOException
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
public Weight createWeight(IndexSearcher searcher) throws IOException
createWeight
in class Query
IOException
public boolean isStrict()
Note: only has effect when the ValueSource part is not null.
public void setStrict(boolean strict)
strict
- The strict mode to set.isStrict()
public String name()
toString(String)
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |