Class FunctionScoreQuery
- java.lang.Object
-
- com.atlassian.confluence.search.v2.query.FunctionScoreQuery
-
- All Implemented Interfaces:
Expandable<SearchQuery>,SearchQuery
@ExperimentalApi @SearchPrimitive public class FunctionScoreQuery extends Object implements SearchQuery
v2 primitive query that modifies the wrapped query score of a retrieved document by combining it according toFunctionScoreQuery.BoostModewith an value provided byScoreFunction.E.g. Assuming a document has a field
page-rankstoring 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 Modifier and Type Class Description static classFunctionScoreQuery.BoostMode
-
Constructor Summary
Constructors Constructor Description FunctionScoreQuery(SearchQuery wrappedQuery, ScoreFunction function, FunctionScoreQuery.BoostMode boostMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)SearchQueryexpand()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.FunctionScoreQuery.BoostModegetBoostMode()ScoreFunctiongetFunction()StringgetKey()ListgetParameters()List of parameters asStrings orSearchQuerys.Stream<SubClause<SearchQuery>>getSubClauses()Returns a stream of nested queries.SearchQuerygetWrappedQuery()inthashCode()-
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 Detail
-
KEY
public static final String KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FunctionScoreQuery
public FunctionScoreQuery(SearchQuery wrappedQuery, ScoreFunction function, FunctionScoreQuery.BoostMode boostMode)
-
-
Method Detail
-
getKey
public String getKey()
- Specified by:
getKeyin interfaceSearchQuery- Returns:
- the plugin key
-
getParameters
public List getParameters()
Description copied from interface:SearchQueryList of parameters asStrings orSearchQuerys.- Specified by:
getParametersin interfaceSearchQuery- Returns:
Strings orSearchQuerys.
-
getBoostMode
public FunctionScoreQuery.BoostMode getBoostMode()
-
getFunction
public ScoreFunction getFunction()
-
getWrappedQuery
public SearchQuery getWrappedQuery()
-
expand
public SearchQuery 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
public Stream<SubClause<SearchQuery>> getSubClauses()
Description copied from interface:SearchQueryReturns a stream of nested queries.- Specified by:
getSubClausesin interfaceSearchQuery
-
-