Please read this answer to a similar question I have below Elasticsearch, Tire, and Nested queries / associations with ActiveRecord
Lets say I added the following field the the Book model provided in the question above:
field :account_tags, type: Array # [{:account_id => 1, :tags => ["tag1", "tag2"], :acccount_id => 2, :tags => ["tag3", "tag4"] }]
I now would like to set up an index to seach these account_ids or tags.
How would I do so?
I have solved this problem and was straight forward. My mapping looks like
My to_indexed_json looks like
Now I can search via
This is a bare boned solution that I used to prototype a system.