@@ -20,12 +20,6 @@ public class FilterDescriptor : FilterDescriptor<dynamic>
2020
2121 public class FilterDescriptor < T > : BaseFilter , IFilterDescriptor < T > where T : class
2222 {
23- private readonly TypeNameResolver typeNameResolver ;
24- public FilterDescriptor ( )
25- {
26- this . typeNameResolver = new TypeNameResolver ( ) ;
27- }
28-
2923 internal string _Name { get ; set ; }
3024 internal string _CacheKey { get ; set ; }
3125 internal bool ? _Cache { get ; set ; }
@@ -453,15 +447,15 @@ public BaseFilter GeoDistanceRange(string field, Action<GeoDistanceRangeFilterDe
453447 }
454448
455449 /// <summary>
456- /// Filters documents that exists within a range from a specific point:
450+ /// Filter documents indexed using the geo_shape type.
457451 /// </summary>
458452 public BaseFilter GeoShape ( Expression < Func < T , object > > fieldDescriptor , Action < GeoShapeFilterDescriptor > filterDescriptor )
459453 {
460454 var field = new PropertyNameResolver ( ) . Resolve ( fieldDescriptor ) ;
461455 return this . GeoShape ( field , filterDescriptor ) ;
462456 }
463457 /// <summary>
464- /// Filters documents that exists within a range from a specific point:
458+ /// Filter documents indexed using the geo_shape type.
465459 /// </summary>
466460 public BaseFilter GeoShape ( string field , Action < GeoShapeFilterDescriptor > filterDescriptor )
467461 {
@@ -479,6 +473,34 @@ public BaseFilter GeoShape(string field, Action<GeoShapeFilterDescriptor> filter
479473 } ) ;
480474
481475 }
476+ /// <summary>
477+ /// Filter documents indexed using the geo_shape type.
478+ /// </summary>
479+ public BaseFilter GeoIndexedShape ( Expression < Func < T , object > > fieldDescriptor , Action < GeoIndexedShapeFilterDescriptor > filterDescriptor )
480+ {
481+ var field = new PropertyNameResolver ( ) . Resolve ( fieldDescriptor ) ;
482+ return this . GeoIndexedShape ( field , filterDescriptor ) ;
483+ }
484+ /// <summary>
485+ /// Filter documents indexed using the geo_shape type.
486+ /// </summary>
487+ public BaseFilter GeoIndexedShape ( string field , Action < GeoIndexedShapeFilterDescriptor > filterDescriptor )
488+ {
489+ var filter = new GeoIndexedShapeFilterDescriptor ( ) ;
490+ if ( filterDescriptor == null )
491+ return CreateConditionlessFilterDescriptor ( "geo_shape" , filter ) ;
492+
493+ filterDescriptor ( filter ) ;
494+ if ( filter . IsConditionless )
495+ return CreateConditionlessFilterDescriptor ( "geo_shape" , filter ) ;
496+
497+ return this . SetDictionary ( "geo_shape" , field , filter , ( d , b ) =>
498+ {
499+ b . GeoShapeFilter = d ;
500+ } ) ;
501+
502+ }
503+
482504
483505 /// <summary>
484506 /// A filter allowing to include hits that only fall within a polygon of points.
0 commit comments