Class: OpenSearch::DSL::Search::Aggregations::ReverseNested

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

Overview

A single-bucket aggregation which allows to aggregate on “parent” documents from the nested documents

See the integration test for a full example.

Examples:


search do
  aggregation :offers do
    nested do
      path 'offers'
      aggregation :top_categories do
        reverse_nested do
          aggregation :top_category_per_offer do
            terms field: 'category'
          end
        end
      end
    end
  end
end

See Also:

Method Summary

Methods included from BaseAggregationComponent

included