public class FunctionScoreQuery
extends org.apache.lucene.search.Query
| Modifier and Type | Class | Description |
|---|---|---|
static class |
FunctionScoreQuery.FilterScoreFunction |
|
static class |
FunctionScoreQuery.ScoreMode |
| Modifier and Type | Field | Description |
|---|---|---|
protected CombineFunction |
combineFunction |
|
static float |
DEFAULT_MAX_BOOST |
| Constructor | Description |
|---|---|
FunctionScoreQuery(org.apache.lucene.search.Query subQuery,
java.lang.Float minScore,
float maxBoost) |
Creates a FunctionScoreQuery without function.
|
FunctionScoreQuery(org.apache.lucene.search.Query subQuery,
FunctionScoreQuery.ScoreMode scoreMode,
ScoreFunction[] functions,
CombineFunction combineFunction,
java.lang.Float minScore,
float maxBoost) |
Creates a FunctionScoreQuery with multiple score functions
|
FunctionScoreQuery(org.apache.lucene.search.Query subQuery,
ScoreFunction function) |
Creates a FunctionScoreQuery with a single
ScoreFunction |
FunctionScoreQuery(org.apache.lucene.search.Query subQuery,
ScoreFunction function,
CombineFunction combineFunction,
java.lang.Float minScore,
float maxBoost) |
Creates a FunctionScoreQuery with a single function
|
| Modifier and Type | Method | Description |
|---|---|---|
org.apache.lucene.search.Weight |
createWeight(org.apache.lucene.search.IndexSearcher searcher,
boolean needsScores,
float boost) |
|
boolean |
equals(java.lang.Object o) |
|
ScoreFunction[] |
getFunctions() |
|
java.lang.Float |
getMinScore() |
|
org.apache.lucene.search.Query |
getSubQuery() |
|
int |
hashCode() |
|
org.apache.lucene.search.Query |
rewrite(org.apache.lucene.index.IndexReader reader) |
|
java.lang.String |
toString(java.lang.String field) |
public static final float DEFAULT_MAX_BOOST
protected final CombineFunction combineFunction
public FunctionScoreQuery(org.apache.lucene.search.Query subQuery,
java.lang.Float minScore,
float maxBoost)
subQuery - The query to match.minScore - The minimum score to consider a document.maxBoost - The maximum applicable boost.public FunctionScoreQuery(org.apache.lucene.search.Query subQuery,
ScoreFunction function)
ScoreFunctionsubQuery - The query to match.function - The ScoreFunction to apply.public FunctionScoreQuery(org.apache.lucene.search.Query subQuery,
ScoreFunction function,
CombineFunction combineFunction,
java.lang.Float minScore,
float maxBoost)
subQuery - The query to match.function - The ScoreFunction to apply.combineFunction - Defines how the query and function score should be applied.minScore - The minimum score to consider a document.maxBoost - The maximum applicable boost.public FunctionScoreQuery(org.apache.lucene.search.Query subQuery,
FunctionScoreQuery.ScoreMode scoreMode,
ScoreFunction[] functions,
CombineFunction combineFunction,
java.lang.Float minScore,
float maxBoost)
subQuery - The query to match.scoreMode - Defines how the different score functions should be combined.functions - The ScoreFunctions to apply.combineFunction - Defines how the query and function score should be applied.minScore - The minimum score to consider a document.maxBoost - The maximum applicable boost.public org.apache.lucene.search.Query getSubQuery()
public ScoreFunction[] getFunctions()
public java.lang.Float getMinScore()
public org.apache.lucene.search.Query rewrite(org.apache.lucene.index.IndexReader reader)
throws java.io.IOException
rewrite in class org.apache.lucene.search.Queryjava.io.IOExceptionpublic org.apache.lucene.search.Weight createWeight(org.apache.lucene.search.IndexSearcher searcher,
boolean needsScores,
float boost)
throws java.io.IOException
createWeight in class org.apache.lucene.search.Queryjava.io.IOExceptionpublic java.lang.String toString(java.lang.String field)
toString in class org.apache.lucene.search.Querypublic boolean equals(java.lang.Object o)
equals in class org.apache.lucene.search.Querypublic int hashCode()
hashCode in class org.apache.lucene.search.Query