public final class FunctionScoreQuery extends Query
Constructor and Description |
---|
FunctionScoreQuery(Query in,
DoubleValuesSource source)
Create a new FunctionScoreQuery
|
Modifier and Type | Method and Description |
---|---|
static FunctionScoreQuery |
boostByQuery(Query in,
Query boostMatch,
float boostValue)
Returns a FunctionScoreQuery where the scores of a wrapped query are multiplied by
a boost factor if the document being scored also matches a separate boosting query.
|
static FunctionScoreQuery |
boostByValue(Query in,
DoubleValuesSource boost)
Returns a FunctionScoreQuery where the scores of a wrapped query are multiplied by
the value of a DoubleValuesSource.
|
Weight |
createWeight(IndexSearcher searcher,
ScoreMode scoreMode,
float boost) |
boolean |
equals(Object o) |
DoubleValuesSource |
getSource() |
Query |
getWrappedQuery() |
int |
hashCode() |
Query |
rewrite(IndexReader reader) |
String |
toString(String field) |
void |
visit(QueryVisitor visitor) |
classHash, sameClassAs, toString
public FunctionScoreQuery(Query in, DoubleValuesSource source)
in
- the query to wrapsource
- a source of scorespublic Query getWrappedQuery()
public DoubleValuesSource getSource()
public static FunctionScoreQuery boostByValue(Query in, DoubleValuesSource boost)
in
- the query to boostboost
- a DoubleValuesSource
containing the boost valuespublic static FunctionScoreQuery boostByQuery(Query in, Query boostMatch, float boostValue)
in
- the query to boostboostMatch
- the boosting queryboostValue
- the amount to boost documents which match the boosting querypublic Weight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException
createWeight
in class Query
IOException
public Query rewrite(IndexReader reader) throws IOException
rewrite
in class Query
IOException
public void visit(QueryVisitor visitor)
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.