Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.elasticsearch.common.geo.ShapeRelation;
import org.elasticsearch.common.geo.builders.ShapeBuilder;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.index.query.DistanceFeatureQueryBuilder.Origin;
import org.elasticsearch.index.query.MoreLikeThisQueryBuilder.Item;
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder;
import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder;
Expand Down Expand Up @@ -100,6 +101,16 @@ public static DisMaxQueryBuilder disMaxQuery() {
return new DisMaxQueryBuilder();
}

/**
* A query to boost scores based on their proximity to the given origin for date, date_nanos and geo_point field types.
* @param name The field name
* @param origin The origin of the distance calculation. Can be a long, string or {@link GeoPoint}, depending on field type.
* @param pivot The distance from the origin at which relevance scores receive half of the boost value.
*/
public static DistanceFeatureQueryBuilder distanceFeatureQuery(String name, Origin origin, String pivot) {
return new DistanceFeatureQueryBuilder(name, origin, pivot);
}

/**
* Constructs a query that will match only specific ids within all types.
*/
Expand Down