Class FunctionScoreQuery.Builder
java.lang.Object
org.opensearch.client.util.ObjectBuilderBase
org.opensearch.client.opensearch._types.query_dsl.QueryBase.AbstractBuilder<FunctionScoreQuery.Builder>
org.opensearch.client.opensearch._types.query_dsl.FunctionScoreQuery.Builder
- All Implemented Interfaces:
CopyableBuilder<FunctionScoreQuery.Builder,,FunctionScoreQuery> MutableBuilder<FunctionScoreQuery.Builder,,FunctionScoreQuery> ObjectBuilder<FunctionScoreQuery>
- Enclosing class:
FunctionScoreQuery
public static class FunctionScoreQuery.Builder
extends QueryBase.AbstractBuilder<FunctionScoreQuery.Builder>
implements CopyableBuilder<FunctionScoreQuery.Builder,FunctionScoreQuery>
Builder for
FunctionScoreQuery.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboostMode(FunctionBoostMode value) API name:boost_modebuild()Builds aFunctionScoreQuery.copy()Create a new builderCopyableBuilderthat is a copy of this one.One or more functions that compute a new score for each document returned by the query.functions(List<FunctionScore> list) One or more functions that compute a new score for each document returned by the query.functions(FunctionScore value, FunctionScore... values) One or more functions that compute a new score for each document returned by the query.Restricts the new score to not exceed the provided limit.Excludes documents that do not meet the provided score threshold.API name:queryAPI name:queryscoreMode(FunctionScoreMode value) API name:score_modeprotected FunctionScoreQuery.Builderself()Methods inherited from class org.opensearch.client.opensearch._types.query_dsl.QueryBase.AbstractBuilder
boost, queryNameMethods inherited from class org.opensearch.client.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _listCopy, _mapCopy, _mapPut, _mapPutAllMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensearch.client.util.MutableBuilder
applyMutation
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
copy
Description copied from interface:CopyableBuilderCreate a new builderCopyableBuilderthat is a copy of this one.- Specified by:
copyin interfaceCopyableBuilder<FunctionScoreQuery.Builder,FunctionScoreQuery> - Returns:
- a new builder instance.
-
self
- Specified by:
selfin classQueryBase.AbstractBuilder<FunctionScoreQuery.Builder>
-
boostMode
API name:boost_mode -
functions
One or more functions that compute a new score for each document returned by the query.API name:
functionsAdds all elements of
listtofunctions. -
functions
@Nonnull public final FunctionScoreQuery.Builder functions(FunctionScore value, FunctionScore... values) One or more functions that compute a new score for each document returned by the query.API name:
functionsAdds one or more values to
functions. -
functions
@Nonnull public final FunctionScoreQuery.Builder functions(Function<FunctionScore.Builder, ObjectBuilder<FunctionScore>> fn) One or more functions that compute a new score for each document returned by the query.API name:
functionsAdds a value to
functionsusing a builder lambda. -
maxBoost
Restricts the new score to not exceed the provided limit.API name:
max_boost -
minScore
Excludes documents that do not meet the provided score threshold.API name:
min_score -
query
API name:query -
query
@Nonnull public final FunctionScoreQuery.Builder query(Function<Query.Builder, ObjectBuilder<Query>> fn) API name:query -
scoreMode
API name:score_mode -
build
Builds aFunctionScoreQuery.- Specified by:
buildin interfaceObjectBuilder<FunctionScoreQuery>- Throws:
NullPointerException- if some of the required fields are null.
-