# How to get the selected fields from a search that are not under the \_source?

**URL:** <https://discuss.elastic.co/t/how-to-get-the-selected-fields-from-a-search-that-are-not-under-the-source/230170>\
**Category:** Elasticsearch\
**Created:** [April 28, 2020, 12:41pm UTC](https://discuss.elastic.co/t/how-to-get-the-selected-fields-from-a-search-that-are-not-under-the-source/230170 "2020-04-28T12:41:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudosu](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@sudosu](https://discuss.elastic.co/u/sudosu)\
**Post date:** [April 28, 2020, 12:41pm UTC](https://discuss.elastic.co/t/how-to-get-the-selected-fields-from-a-search-that-are-not-under-the-source/230170/1 "2020-04-28T12:41:51Z")

</div>

Hi,  
I am trying to get only the fields selected from a search. I know that we can use include / exclude to select parts of \_source:  
But how about the fields that are not under the \_source?  
For example how to filter only the \_index, \_type and \_score from the object below?

```auto
     "_index": "kibana_sample_data_logs",
                    "_type": "_doc",
                    "_id": "DTMTgnEBbYNxp5GHcvak",
                    "_version": 1,
                    "_score": null,
                    "_source": {
                        "agent": "Mozilla/4.0 ",
                        "extension": "",
                        "url": "https://www.elastic.co/downloads",
                        "tags": [
                            "success",
                            "info"
                        ],
                        "geo": {
                            "srcdest": "TH:CN",
                            "src": "TH",
                            "coordinates": {
                                "lon": -73.27455556,
                                "lat": 43.61534389
                            },
                        },

```

---

<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:** [May 26, 2020, 12:44pm UTC](https://discuss.elastic.co/t/how-to-get-the-selected-fields-from-a-search-that-are-not-under-the-source/230170/2 "2020-05-26T12:44:44Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
