Class: OpenSearch::DSL::Search::Filters::GeohashCell

Inherits:
Object
  • Object
show all
Includes:
BaseComponent
Defined in:
lib/opensearch/dsl/search/filters/geohash_cell.rb

Overview

A filter which translates lat/lon values into a geohash with the specified precision and returns all documents which fall into it

See the integration test for a working example.

Examples:


search do
  query do
    filtered do
      filter do
        geohash_cell :location do
          lat '50.090223'
          lon '14.399590'
          precision '5km'
          neighbors true
        end
      end
    end
  end
end

See Also:

Instance Method Summary collapse

Methods included from BaseComponent

included

Constructor Details

#initialize(*args, &block) ⇒ GeohashCell

Returns a new instance of GeohashCell.



64
65
66
67
# File 'lib/opensearch/dsl/search/filters/geohash_cell.rb', line 64

def initialize(*args, &block)
  super
  @hash[self.name.to_sym] = { @args => {} } unless @args.empty?
end