55using Tests . Domain ;
66using Tests . Framework . EndpointTests . TestState ;
77
8- namespace Tests . QueryDsl . Geo . Shape
8+ namespace Tests . QueryDsl . Specialized . Shape
99{
1010 /**
1111 * Like geo_shape, Elasticsearch supports the ability to index arbitrary two dimension (non Geospatial) geometries making
@@ -14,6 +14,7 @@ namespace Tests.QueryDsl.Geo.Shape
1414 *
1515 * See the Elasticsearch documentation on {ref_current}/query-dsl-shape-query.html[shape queries] for more detail.
1616 */
17+ [ SkipVersion ( "<7.4.0" , "Shape queries introduced in 7.4.0+" ) ]
1718 public abstract class ShapeQueryUsageTestsBase : QueryDslUsageTestsBase
1819 {
1920 protected static readonly GeoCoordinate CircleCoordinates = new GeoCoordinate ( - 45.0 , 45.0 ) ;
@@ -153,58 +154,6 @@ protected override QueryContainer QueryFluent(QueryContainerDescriptor<Project>
153154 ) ;
154155 }
155156
156- // hide
157- [ SkipVersion ( ">=7.0.0" , "Multipoint queries are not supported in shape queries" ) ]
158- public class ShapeMultiPointQueryUsageTests : ShapeQueryUsageTestsBase
159- {
160- public ShapeMultiPointQueryUsageTests ( ReadOnlyCluster i , EndpointUsage usage ) : base ( i , usage ) { }
161-
162- protected override ConditionlessWhen ConditionlessWhen => new ConditionlessWhen < IShapeQuery > ( a => a . Shape )
163- {
164- q => q . Field = null ,
165- q => q . Shape = null ,
166- q => ( ( IMultiPointGeoShape ) q . Shape ) . Coordinates = null ,
167- } ;
168-
169- protected override QueryContainer QueryInitializer => new ShapeQuery
170- {
171- Name = "named_query" ,
172- Boost = 1.1 ,
173- Field = Infer . Field < Project > ( p => p . ArbitraryShape ) ,
174- Shape = new MultiPointGeoShape ( MultiPointCoordinates ) ,
175- Relation = ShapeRelation . Intersects ,
176- } ;
177-
178- protected override object QueryJson => new
179- {
180- shape = new
181- {
182- _name = "named_query" ,
183- boost = 1.1 ,
184- arbitraryShape = new
185- {
186- relation = "intersects" ,
187- shape = new
188- {
189- type = "multipoint" ,
190- coordinates = MultiPointCoordinates
191- }
192- }
193- }
194- } ;
195-
196- protected override QueryContainer QueryFluent ( QueryContainerDescriptor < Project > q ) => q
197- . Shape ( c => c
198- . Name ( "named_query" )
199- . Boost ( 1.1 )
200- . Field ( p => p . ArbitraryShape )
201- . Shape ( s => s
202- . MultiPoint ( MultiPointCoordinates )
203- )
204- . Relation ( ShapeRelation . Intersects )
205- ) ;
206- }
207-
208157 /**
209158 * [float]
210159 * [[shape-query-linestring]]
@@ -597,59 +546,6 @@ protected override QueryContainer QueryFluent(QueryContainerDescriptor<Project>
597546 ) ;
598547 }
599548
600- // hide
601- [ SkipVersion ( ">=7.0.0" , "Circle queries are not supported in shape queries" ) ]
602- public class ShapeCircleQueryUsageTests : ShapeQueryUsageTestsBase
603- {
604- public ShapeCircleQueryUsageTests ( ReadOnlyCluster i , EndpointUsage usage ) : base ( i , usage ) { }
605-
606- protected override ConditionlessWhen ConditionlessWhen => new ConditionlessWhen < IShapeQuery > ( a => a . Shape )
607- {
608- q => q . Field = null ,
609- q => q . Shape = null ,
610- q => ( ( ICircleGeoShape ) q . Shape ) . Coordinates = null ,
611- } ;
612-
613- protected override QueryContainer QueryInitializer => new ShapeQuery
614- {
615- Name = "named_query" ,
616- Boost = 1.1 ,
617- Field = Infer . Field < Project > ( p => p . ArbitraryShape ) ,
618- Shape = new CircleGeoShape ( CircleCoordinates , "100m" ) ,
619- Relation = ShapeRelation . Intersects ,
620- } ;
621-
622- protected override object QueryJson => new
623- {
624- shape = new
625- {
626- _name = "named_query" ,
627- boost = 1.1 ,
628- arbitraryShape = new
629- {
630- relation = "intersects" ,
631- shape = new
632- {
633- type = "circle" ,
634- radius = "100m" ,
635- coordinates = CircleCoordinates
636- }
637- }
638- }
639- } ;
640-
641- protected override QueryContainer QueryFluent ( QueryContainerDescriptor < Project > q ) => q
642- . Shape ( c => c
643- . Name ( "named_query" )
644- . Boost ( 1.1 )
645- . Field ( p => p . ArbitraryShape )
646- . Shape ( s => s
647- . Circle ( CircleCoordinates , "100m" )
648- )
649- . Relation ( ShapeRelation . Intersects )
650- ) ;
651- }
652-
653549 /**
654550 * [float]
655551 * [[shape-query-indexedshape]]
0 commit comments