I have a Rails app with ActiveRecord models that have associations between them.
For the sake of simplicity, lets say I have exactly the same DB schema as in - https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-model/examples/activerecord_associations.rb#L95
And I would want to search for Article author named 'John'.
Article.search('john')
searches in article.authors' specified fields first_name and last_name as expected.
I want to be more specific and say search from Article through article.authors by first_name only.
Article.search(authors: {first_name: 'john'})
does not work.
What is the correct way to do the above?
Also using Elastic HQ, in the articles index there's field authors. Does that mean that the elasticsearch-rails indexing is correct and nested authors?