Class: OpenSearch::DSL::Search::Aggregations::GeoDistance

Inherits:
Object
  • Object
show all
Includes:
BaseAggregationComponent
Defined in:
lib/opensearch/dsl/search/aggregations/geo_distance.rb

Overview

A multi-bucket aggregation which will return document counts for distance perimeters, defined as ranges

See the integration test for a full example.

Examples:


search do
  aggregation :venue_distances do
    geo_distance do
      field  :location
      origin '38.9126352,1.4350621'
      unit   'km'
      ranges [ { to: 1 }, { from: 1, to: 5 }, { from: 5, to: 10 }, { from: 10 } ]
    end
  end
end

See Also:

Method Summary

Methods included from BaseAggregationComponent

included