Class: Arelastic::Queries::GeoPolygon
- Inherits:
-
Query
- Object
- Nodes::Node
- Query
- Arelastic::Queries::GeoPolygon
- Defined in:
- lib/arelastic/queries/geo_polygon.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#options ⇒ Object
Returns the value of attribute options.
-
#points ⇒ Object
Returns the value of attribute points.
Instance Method Summary collapse
- #as_elastic ⇒ Object
-
#initialize(field, points, options = {}) ⇒ GeoPolygon
constructor
A new instance of GeoPolygon.
Methods inherited from Query
#has_child, #has_parent, #negate, #nested
Methods inherited from Nodes::Node
#==, #convert_to_elastic, #hash, #read_option!
Methods included from Arities::Binary
Methods included from Arities::Polyadic
Methods included from Arities::Unary
Constructor Details
#initialize(field, points, options = {}) ⇒ GeoPolygon
Returns a new instance of GeoPolygon.
6 7 8 9 10 11 12 |
# File 'lib/arelastic/queries/geo_polygon.rb', line 6 def initialize(field, points, = {}) warn 'Arelastic::Queries::GeoPolygon is deprecated in Elastic Search 7.12;' + 'Use Arelastic::Queries::GeoShape instead.' @field = field @points = points @options = end |
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
4 5 6 |
# File 'lib/arelastic/queries/geo_polygon.rb', line 4 def field @field end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/arelastic/queries/geo_polygon.rb', line 4 def @options end |
#points ⇒ Object
Returns the value of attribute points.
4 5 6 |
# File 'lib/arelastic/queries/geo_polygon.rb', line 4 def points @points end |
Instance Method Details
#as_elastic ⇒ Object
14 15 16 17 18 |
# File 'lib/arelastic/queries/geo_polygon.rb', line 14 def as_elastic params = { field => { 'points' => points } }.update() { 'geo_polygon' => params } end |