File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
server/src/main/java/org/elasticsearch/index/query Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 2525import org .elasticsearch .common .geo .ShapeRelation ;
2626import org .elasticsearch .common .geo .builders .ShapeBuilder ;
2727import org .elasticsearch .geometry .Geometry ;
28+ import org .elasticsearch .index .query .DistanceFeatureQueryBuilder .Origin ;
2829import org .elasticsearch .index .query .MoreLikeThisQueryBuilder .Item ;
2930import org .elasticsearch .index .query .functionscore .FunctionScoreQueryBuilder ;
3031import org .elasticsearch .index .query .functionscore .ScoreFunctionBuilder ;
@@ -113,6 +114,16 @@ public static DisMaxQueryBuilder disMaxQuery() {
113114 return new DisMaxQueryBuilder ();
114115 }
115116
117+ /**
118+ * A query to boost scores based on their proximity to the given origin for date, date_nanos and geo_point field types.
119+ * @param name The field name
120+ * @param origin The origin of the distance calculation. Can be a long, string or {@link GeoPoint}, depending on field type.
121+ * @param pivot The distance from the origin at which relevance scores receive half of the boost value.
122+ */
123+ public static DistanceFeatureQueryBuilder distanceFeatureQuery (String name , Origin origin , String pivot ) {
124+ return new DistanceFeatureQueryBuilder (name , origin , pivot );
125+ }
126+
116127 /**
117128 * Constructs a query that will match only specific ids within all types.
118129 */
You can’t perform that action at this time.
0 commit comments