File tree 1 file changed +11
-0
lines changed
server/src/main/java/org/elasticsearch/index/query
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 25
25
import org .elasticsearch .common .geo .ShapeRelation ;
26
26
import org .elasticsearch .common .geo .builders .ShapeBuilder ;
27
27
import org .elasticsearch .geometry .Geometry ;
28
+ import org .elasticsearch .index .query .DistanceFeatureQueryBuilder .Origin ;
28
29
import org .elasticsearch .index .query .MoreLikeThisQueryBuilder .Item ;
29
30
import org .elasticsearch .index .query .functionscore .FunctionScoreQueryBuilder ;
30
31
import org .elasticsearch .index .query .functionscore .ScoreFunctionBuilder ;
@@ -100,6 +101,16 @@ public static DisMaxQueryBuilder disMaxQuery() {
100
101
return new DisMaxQueryBuilder ();
101
102
}
102
103
104
+ /**
105
+ * A query to boost scores based on their proximity to the given origin for date, date_nanos and geo_point field types.
106
+ * @param name The field name
107
+ * @param origin The origin of the distance calculation. Can be a long, string or {@link GeoPoint}, depending on field type.
108
+ * @param pivot The distance from the origin at which relevance scores receive half of the boost value.
109
+ */
110
+ public static DistanceFeatureQueryBuilder distanceFeatureQuery (String name , Origin origin , String pivot ) {
111
+ return new DistanceFeatureQueryBuilder (name , origin , pivot );
112
+ }
113
+
103
114
/**
104
115
* Constructs a query that will match only specific ids within all types.
105
116
*/
You can’t perform that action at this time.
0 commit comments