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
Nested Classes -
Field Summary
FieldsFields inherited from interface com.atlassian.confluence.search.v2.SearchQuery
DEFAULT_BOOST -
Constructor Summary
ConstructorsConstructorDescriptionFunctionScoreQuery(SearchQuery wrappedQuery, ScoreFunction function, FunctionScoreQuery.BoostMode boostMode) -
Method Summary
Modifier and TypeMethodDescriptionbooleanexpand()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 asStrings orSearchQuerys.Returns a stream of nested queries.inthashCode()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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:
getKeyin interfaceSearchQuery- Returns:
- the plugin key
-
getParameters
Description copied from interface:SearchQueryList of parameters asStrings orSearchQuerys.- Specified by:
getParametersin interfaceSearchQuery- Returns:
Strings orSearchQuerys.
-
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:
expandin interfaceExpandable<SearchQuery>- Specified by:
expandin interfaceSearchQuery- Returns:
- a query
-
getSubClauses
Description copied from interface:SearchQueryReturns a stream of nested queries.- Specified by:
getSubClausesin interfaceSearchQuery
-
equals
-
hashCode
public int hashCode()
-