elasticsearch-rails

https://github.com/elastic/elasticsearch-rails

Ruby

Elasticsearch integrations for ActiveModel/Record and Ruby on Rails

Elasticsearch::Model::Adapter::Multiple::Records#__records_by_type

 Returns the collection of records grouped by class based on `_type`

Example:

{
  Foo  => {"1"=> #<Foo id: 1, title: "ABC"}, ...},
  Bar  => {"1"=> #<Bar id: 1, name: "XYZ"}, ...}
}

Source | Google | Stack overflow

Edit

git clone [email protected]:elastic/elasticsearch-rails.git

cd elasticsearch-rails

open elasticsearch-model/lib/elasticsearch/model/adapters/multiple.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Elasticsearch--Model--Adapter--Multiple--Records-__records_by_type-for-pr


# Commit to git

git add elasticsearch-model/lib/elasticsearch/model/adapters/multiple.rbgit commit -m "better docs for Elasticsearch::Model::Adapter::Multiple::Records#__records_by_type"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Elasticsearch--Model--Adapter--Multiple--Records-__records_by_type-for-pr

hub pull-request


# Celebrate!