File tree 1 file changed +18
-0
lines changed
server/src/main/java/org/elasticsearch/index/query
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -173,6 +173,24 @@ public String getWriteableName() {
173
173
return NAME ;
174
174
}
175
175
176
+ /**
177
+ * Sets the relation of query shape and indexed shape.
178
+ *
179
+ * @param relation relation of the shapes
180
+ * @return this
181
+ */
182
+ public GeoShapeQueryBuilder relation (ShapeRelation relation ) {
183
+ if (relation == null ) {
184
+ throw new IllegalArgumentException ("No Shape Relation defined" );
185
+ }
186
+ if (SpatialStrategy .TERM .equals (strategy ) && relation != ShapeRelation .INTERSECTS ) {
187
+ throw new IllegalArgumentException ("current strategy [" + strategy .getStrategyName () + "] only supports relation ["
188
+ + ShapeRelation .INTERSECTS .getRelationName () + "] found relation [" + relation .getRelationName () + "]" );
189
+ }
190
+ this .relation = relation ;
191
+ return this ;
192
+ }
193
+
176
194
/**
177
195
* Defines which spatial strategy will be used for building the geo shape
178
196
* Query. When not set, the strategy that will be used will be the one that
You can’t perform that action at this time.
0 commit comments