Class DistanceFeatureQuery.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch._types.query_dsl.QueryBase.AbstractBuilder<DistanceFeatureQuery.Builder>
co.elastic.clients.elasticsearch._types.query_dsl.DistanceFeatureQuery.Builder
- All Implemented Interfaces:
WithJson<DistanceFeatureQuery.Builder>,ObjectBuilder<DistanceFeatureQuery>
- Enclosing class:
- DistanceFeatureQuery
public static class DistanceFeatureQuery.Builder
extends QueryBase.AbstractBuilder<DistanceFeatureQuery.Builder>
implements ObjectBuilder<DistanceFeatureQuery>
Builder for
DistanceFeatureQuery.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aDistanceFeatureQuery.Required - Name of the field used to calculate distances.Required - Date or point of origin used to calculate distances.Required - Distance from theoriginat which relevance scores receive half of theboostvalue.protected DistanceFeatureQuery.Builderself()Methods inherited from class co.elastic.clients.elasticsearch._types.query_dsl.QueryBase.AbstractBuilder
boost, queryNameMethods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
origin
Required - Date or point of origin used to calculate distances. If thefieldvalue is adateordate_nanosfield, theoriginvalue must be a date. Date Math, such asnow-1h, is supported. If the field value is ageo_pointfield, theoriginvalue must be a geopoint.API name:
origin -
pivot
Required - Distance from theoriginat which relevance scores receive half of theboostvalue. If thefieldvalue is adateordate_nanosfield, thepivotvalue must be a time unit, such as1hor10d. If thefieldvalue is ageo_pointfield, thepivotvalue must be a distance unit, such as1kmor12m.API name:
pivot -
field
Required - Name of the field used to calculate distances. This field must meet the following criteria: be adate,date_nanosorgeo_pointfield; have anindexmapping parameter value oftrue, which is the default; have andoc_valuesmapping parameter value oftrue, which is the default.API name:
field -
self
- Specified by:
selfin classQueryBase.AbstractBuilder<DistanceFeatureQuery.Builder>
-
build
Builds aDistanceFeatureQuery.- Specified by:
buildin interfaceObjectBuilder<DistanceFeatureQuery>- Throws:
NullPointerException- if some of the required fields are null.
-