# When to use fields and when to use source filtering

**URL:** <https://discuss.elastic.co/t/when-to-use-fields-and-when-to-use-source-filtering/21352>\
**Category:** Elasticsearch\
**Created:** [December 22, 2014, 12:28pm UTC](https://discuss.elastic.co/t/when-to-use-fields-and-when-to-use-source-filtering/21352 "2014-12-22T12:28:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shelef](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@Shelef](https://discuss.elastic.co/u/Shelef)\
**Post date:** [December 22, 2014, 12:28pm UTC](https://discuss.elastic.co/t/when-to-use-fields-and-when-to-use-source-filtering/21352/1 "2014-12-22T12:28:57Z")

</div>

I read about two ways to filter the fields returned by elasticsearch. fields  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html)  
And source filtering  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html).  
when to use which?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [December 22, 2014, 12:33pm UTC](https://discuss.elastic.co/t/when-to-use-fields-and-when-to-use-source-filtering/21352/2 "2014-12-22T12:33:20Z")

</div>

Fields are used to pull data from stored fields whereas source filtering is  
targeting \_source. At the moment both fallback on each other, so the  
differences is in the order of precedence. I believe I've heard there're  
plans to deprecate fields completely, wonder if someone from ES could  
confirm?

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)

On Mon, Dec 22, 2014 at 2:28 PM, Shelef [shlaflaf@gmail.com](mailto:shlaflaf@gmail.com) wrote:

> I read about two ways to filter the fields returned by elasticsearch.  
> fields  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html)  
> And source filtering  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html).  
> when to use which?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtVDGbnuBdGgxHavr3O9ToO%2BC\_5Tg%3DE8tntw\_5yW%3Djm%3Dg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtVDGbnuBdGgxHavr3O9ToO%2BC_5Tg%3DE8tntw_5yW%3Djm%3Dg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [December 22, 2014, 12:40pm UTC](https://discuss.elastic.co/t/when-to-use-fields-and-when-to-use-source-filtering/21352/3 "2014-12-22T12:40:26Z")

</div>

General rule:

- Use source filtering unless you can't. Source filtering works if the  
field is in the document you indexed. Fields is required if you want to  
load a stored field. You only _need_ to store fields if they are synthetic  
like from word count or from transform.

Advanced thing I've never used:

- Its possible to get some performance gains by setting a small field to  
stored and fetching it using fields rather than source filtering if the  
document is large and the field is small and you only want the small field.

Nik  
On Dec 22, 2014 7:29 AM, "Shelef" [shlaflaf@gmail.com](mailto:shlaflaf@gmail.com) wrote:

> I read about two ways to filter the fields returned by elasticsearch.  
> fields  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html)  
> And source filtering  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html).  
> when to use which?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0yMv9%3DdjpAOUQ5P%3D0dB1GN8DATghhk2zZgsk%3De14Y8jA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0yMv9%3DdjpAOUQ5P%3D0dB1GN8DATghhk2zZgsk%3De14Y8jA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [December 22, 2014, 12:46pm UTC](https://discuss.elastic.co/t/when-to-use-fields-and-when-to-use-source-filtering/21352/4 "2014-12-22T12:46:43Z")

</div>

Does source fallback? I remember trying and getting nothing.  
On Dec 22, 2014 7:33 AM, "Itamar Syn-Hershko" [itamar@code972.com](mailto:itamar@code972.com) wrote:

> Fields are used to pull data from stored fields whereas source filtering  
> is targeting \_source. At the moment both fallback on each other, so the  
> differences is in the order of precedence. I believe I've heard there're  
> plans to deprecate fields completely, wonder if someone from ES could  
> confirm?
> 
> --
> 
> Itamar Syn-Hershko  
> [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> Freelance Developer & Consultant  
> Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)
> 
> On Mon, Dec 22, 2014 at 2:28 PM, Shelef [shlaflaf@gmail.com](mailto:shlaflaf@gmail.com) wrote:
> 
> > I read about two ways to filter the fields returned by elasticsearch.  
> > fields  
> > [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html)  
> > And source filtering  
> > [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html).  
> > when to use which?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtVDGbnuBdGgxHavr3O9ToO%2BC\_5Tg%3DE8tntw\_5yW%3Djm%3Dg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtVDGbnuBdGgxHavr3O9ToO%2BC_5Tg%3DE8tntw_5yW%3Djm%3Dg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtVDGbnuBdGgxHavr3O9ToO%2BC\_5Tg%3DE8tntw\_5yW%3Djm%3Dg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtVDGbnuBdGgxHavr3O9ToO%2BC_5Tg%3DE8tntw_5yW%3Djm%3Dg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3Q1uf86aPqy4uo9cbpOerPKDONViCwPog6AT7nwiEHJg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3Q1uf86aPqy4uo9cbpOerPKDONViCwPog6AT7nwiEHJg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [December 22, 2014, 12:47pm UTC](https://discuss.elastic.co/t/when-to-use-fields-and-when-to-use-source-filtering/21352/5 "2014-12-22T12:47:57Z")

</div>

From the docs:

By default operations return the contents of the \_source field unless you  
have used the fieldsparameter or if the \_source field is disabled.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)

On Mon, Dec 22, 2014 at 2:46 PM, Nikolas Everett [nik9000@gmail.com](mailto:nik9000@gmail.com) wrote:

> Does source fallback? I remember trying and getting nothing.  
> On Dec 22, 2014 7:33 AM, "Itamar Syn-Hershko" [itamar@code972.com](mailto:itamar@code972.com) wrote:
> 
> > Fields are used to pull data from stored fields whereas source filtering  
> > is targeting \_source. At the moment both fallback on each other, so the  
> > differences is in the order of precedence. I believe I've heard there're  
> > plans to deprecate fields completely, wonder if someone from ES could  
> > confirm?
> > 
> > --
> > 
> > Itamar Syn-Hershko  
> > [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> > Freelance Developer & Consultant  
> > Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)
> > 
> > On Mon, Dec 22, 2014 at 2:28 PM, Shelef [shlaflaf@gmail.com](mailto:shlaflaf@gmail.com) wrote:
> > 
> > > I read about two ways to filter the fields returned by elasticsearch.  
> > > fields  
> > > [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-fields.html)  
> > > And source filtering  
> > > [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-source-filtering.html).  
> > > when to use which?
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0a8593ca-d17f-4f6d-b3b8-b5ee10196892%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtVDGbnuBdGgxHavr3O9ToO%2BC\_5Tg%3DE8tntw\_5yW%3Djm%3Dg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtVDGbnuBdGgxHavr3O9ToO%2BC_5Tg%3DE8tntw_5yW%3Djm%3Dg%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtVDGbnuBdGgxHavr3O9ToO%2BC\_5Tg%3DE8tntw\_5yW%3Djm%3Dg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZtVDGbnuBdGgxHavr3O9ToO%2BC_5Tg%3DE8tntw_5yW%3Djm%3Dg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3Q1uf86aPqy4uo9cbpOerPKDONViCwPog6AT7nwiEHJg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3Q1uf86aPqy4uo9cbpOerPKDONViCwPog6AT7nwiEHJg%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3Q1uf86aPqy4uo9cbpOerPKDONViCwPog6AT7nwiEHJg%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3Q1uf86aPqy4uo9cbpOerPKDONViCwPog6AT7nwiEHJg%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZscB0wvnAGN0%2B6GOF%2BCSV7u-ziH4ybBfpj%3DUa-c7NNUzg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZscB0wvnAGN0%2B6GOF%2BCSV7u-ziH4ybBfpj%3DUa-c7NNUzg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [December 24, 2014, 4:45pm UTC](https://discuss.elastic.co/t/when-to-use-fields-and-when-to-use-source-filtering/21352/6 "2014-12-24T16:45:24Z")

</div>

On Mon, Dec 22, 2014 at 1:33 PM, Itamar Syn-Hershko [itamar@code972.com](mailto:itamar@code972.com)  
wrote:

> Fields are used to pull data from stored fields whereas source filtering  
> is targeting \_source. At the moment both fallback on each other, so the  
> differences is in the order of precedence. I believe I've heard there're  
> plans to deprecate fields completely, wonder if someone from ES could  
> confirm?

I don't think we can deprecate fields because of synthetic fields  
(otherwise you could not eg. highlight them). But it's true that we'd like  
to make it unnecessary for you to store a field if you already have it in  
the \_source. Today `_source` filtering has the drawback that you might need  
to parse a lot of json to get a single value, this is a reason why users  
sometimes prefer storing some fields on their own so that they can be  
retrieved without parsing the \_source. We are thinking about ways to  
mitigate this issue, see eg.

> <https://github.com/elastic/elasticsearch/issues/9034>
>
> Today we store the \`\_source\` is a single big binary stored field. While this is …great for simplicity, this also has the bad side-effect to encourage to store fields individually in order to save some json parsing when there are a couple of large field values and we are only interested in some short values. Maybe we could try to be a bit smarter and store the \`\_source\` across several stored fields so that it would not be an issue anymore?
> 
> Random idea: given a document that looks like:
> 
> \`\`\` json
> {
> "title": "short\_string",
> "body": "very\_very\_very\_very\_long\_string",
> "array": \[2, 3, 10\],
> "foo": {
> "foo": 42,
> "bar": "baz"
> }
> }
> \`\`\`
> 
> we could for instance store all the top-level fields into their own stored field
> 
> | Field | Values |
> | --- | --- |
> | title | "short\_string" |
> | body | "very\_very\_very\_very\_long\_string" |
> | array | \[2, 3, 10\] |
> | foo | {"foo": 42, "bar": "baz"} |
> 
> or maybe even each value individually (but it becomes more complicated with arrays of objects):
> 
> | Field | Values |
> | --- | --- |
> | title | "short\_string" |
> | body | "very\_very\_very\_very\_long\_string" |
> | array | \[2, 3, 10\] |
> | foo.foo | 42 |
> | foo.bar | "baz" |
> 
> Then we would have to make \`\_source\` filtering aware of the way fields are stored, and for instance if we store only top-level fields into their own stored field then we could translate an include rule like \`foo.\*\` to "retrieve field \`foo\`", and \`foo.bar.\*\` to "get everything under \`bar\` for field \`foo\`".

--  
Adrien Grand

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j54F4\_uQTS\_K39r3g\_tAuY%3DHfMGhh%2BFeMwHDo00Zytj5Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j54F4_uQTS_K39r3g_tAuY%3DHfMGhh%2BFeMwHDo00Zytj5Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:42am UTC](https://discuss.elastic.co/t/when-to-use-fields-and-when-to-use-source-filtering/21352/7 "2017-07-06T00:42:01Z")

</div>


