Indexed vs. stored fields

(Michael Smolyak) #1

My Grails project is trying to migrate from Searchable plugin to Elastic
Search plugin. One of the features available in Searchable Plugin is to
specify "index" and "store" attributes for each field. The former attribute
specifies whether the property can be searched upon, while the latter one
determines whether the property is populated when the domain object is
constructed from the search results.

Does Elastic Search plugin offer a similar functionality? Can I index a
property (corresponding to a 1-M relationship) as a component so that I
could search on attributes of the inner objects, but not retrieve the
collection of objects during search?

Can this be done outside of Grails plugin? In SQL I can ask only for
certain columns in the results set (SELECT first_name, last_name ...). Is
it possible to restrict the attributes that I want to receive as a result
of an Elastic Search query? This is a performance issue. If a book on
Amazon has 200 comments, I would like to be able to search for the book
based on its comments. But when I receive the book back, I do not want to
retrieve the comments along with it. How can this be done?

Thank you,


(system) #2