toptal / chewy

High-level Elasticsearch Ruby framework based on the official elasticsearch-ruby client
MIT License
1.88k stars 364 forks source link

Add ES inner_hits support #955

Closed JonathanFrias closed 2 months ago

JonathanFrias commented 2 months ago

Adds support for ElasticSearch's inner hits feature

class A < Chewy::Index
end

A.inner_hits(foo: 'bar')
# => <A::Query {:index=>["a"], :body=>{:inner_hits=>{"foo"=>"bar"}}}>

Fixes #308, #950

This work was derived from https://github.com/toptal/chewy/pull/890