How do I index a specific field on an embedded document using the tire gem for ElasticSearch's syntax?
I have tried the following for my Question model which embeds many Answers and I would like only the description field on the Answer model to be indexed.
Searching for text that should match a stored answer's description is returning no results. I am using Mongoid as my MongoDB driver by the way.
mapping do
indexes :id, :index => :no
indexes :created_at, :index => :no
indexes :updated_at, :index => :no
indexes :title, :index => :analyzed
indexes :description, :index => :analyzed
indexes :page_views, :index => :no
indexes :asker, :index => :no
indexes :tags, :index => :analyzed
indexes :answers do
indexes :id, :index => :no
indexes :description, :index => :analyzed
indexes :answerer, :index => :no
indexes :created_at, :index => :no
indexes :updated_at, :index => :no
end
indexes :comments, :index => :no
indexes :votes, :index => :no
indexes :up_count, :index => :no
indexes :down_count, :index => :no
indexes :vote_score, :index => :no
end