Class FunctionScoreQuery
java.lang.Object
com.atlassian.confluence.search.v2.query.FunctionScoreQuery
- All Implemented Interfaces:
Expandable<SearchQuery>
,SearchQuery
v2 primitive query that modifies the wrapped query score of a retrieved document by combining it according to
FunctionScoreQuery.BoostMode
with an value provided by ScoreFunction
.
E.g. Assuming a document has a field page-rank
storing a float value and we want to adjust a document
score such that a new score will be original text score _score * ln(1 + page-rank)
, the the query would
be
<@code SearchQuery q = new FunctionScoreQuery(new SiteTextSearchQuery("perplexity"), new FieldValueFactorFunction(new FloatFieldValueSource("page-rank"), 1.0, Modifier.LOG1P), FunctionScoreQuery.BoostMode.SUM); >
- Since:
- 7.0
-
Nested Class Summary
-
Field Summary
Fields inherited from interface com.atlassian.confluence.search.v2.SearchQuery
DEFAULT_BOOST
-
Constructor Summary
ConstructorDescriptionFunctionScoreQuery
(SearchQuery wrappedQuery, ScoreFunction function, FunctionScoreQuery.BoostMode boostMode) -
Method Summary
Modifier and TypeMethodDescriptionboolean
expand()
This primitive but is similar toBooleanQuery
, which in some sense primitive but also need to implement expand method, because the wrapped query need to be expanded.getKey()
List of parameters asString
s orSearchQuery
s.Returns a stream of nested queries.int
hashCode()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.search.v2.SearchQuery
getBoost
-
Field Details
-
KEY
- See Also:
-
-
Constructor Details
-
FunctionScoreQuery
public FunctionScoreQuery(SearchQuery wrappedQuery, ScoreFunction function, FunctionScoreQuery.BoostMode boostMode)
-
-
Method Details
-
getKey
- Specified by:
getKey
in interfaceSearchQuery
- Returns:
- the plugin key
-
getParameters
Description copied from interface:SearchQuery
List of parameters asString
s orSearchQuery
s.- Specified by:
getParameters
in interfaceSearchQuery
- Returns:
String
s orSearchQuery
s.
-
getBoostMode
-
getFunction
-
getWrappedQuery
-
expand
This primitive but is similar toBooleanQuery
, which in some sense primitive but also need to implement expand method, because the wrapped query need to be expanded.- Specified by:
expand
in interfaceExpandable<SearchQuery>
- Specified by:
expand
in interfaceSearchQuery
- Returns:
- a query
-
getSubClauses
Description copied from interface:SearchQuery
Returns a stream of nested queries.- Specified by:
getSubClauses
in interfaceSearchQuery
-
equals
-
hashCode
public int hashCode()
-