# Indexed vs. stored fields

**URL:** <https://discuss.elastic.co/t/indexed-vs-stored-fields/7871>\
**Category:** Elasticsearch\
**Created:** [May 25, 2012, 7:40pm UTC](https://discuss.elastic.co/t/indexed-vs-stored-fields/7871 "2012-05-25T19:40:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Smolyak](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@Michael\_Smolyak](https://discuss.elastic.co/u/Michael_Smolyak)\
**Post date:** [May 25, 2012, 7:40pm UTC](https://discuss.elastic.co/t/indexed-vs-stored-fields/7871/1 "2012-05-25T19:40:03Z")

</div>

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,

Michael

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:27am UTC](https://discuss.elastic.co/t/indexed-vs-stored-fields/7871/2 "2017-07-06T03:27:03Z")

</div>

Closed on July 6, 2017, 3:27am UTC


