# What does 'fields' refer to in Kibana-\>Discover-\>JSON view?

**URL:** <https://discuss.elastic.co/t/what-does-fields-refer-to-in-kibana-discover-json-view/366776>\
**Category:** Kibana\
**Created:** [September 19, 2024, 8:29am UTC](https://discuss.elastic.co/t/what-does-fields-refer-to-in-kibana-discover-json-view/366776 "2024-09-19T08:29:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ACoder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/acoder/32/113449_2.png) [@ACoder](https://discuss.elastic.co/u/ACoder)\
**Post date:** [September 19, 2024, 8:29am UTC](https://discuss.elastic.co/t/what-does-fields-refer-to-in-kibana-discover-json-view/366776/1 "2024-09-19T08:29:34Z")

</div>

When I analyze my indices in Discover Tab and click on a doc, and view it in JSON view:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/4/545b6d76e331003cfc2f5e9ce3f38128ff92e7a7.png)  
I can see a property called `fields`. It lists all fields in the doc.  
Does it have any relationship to index as in:

> **[fields | Elasticsearch Guide \[8.15\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html)**

But I only indexed following fields.

```auto
{
  "mappings": {
    "dynamic": "false",
    "properties": {
      "courseId": {
        "type": "keyword"
      },
      "createdAt": {
        "type": "date"
      },
      "idTokenSub": {
        "type": "keyword"
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![jughosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jughosta/32/107160_2.png) [@jughosta](https://discuss.elastic.co/u/jughosta)\
**Post date:** [September 19, 2024, 9:28am UTC](https://discuss.elastic.co/t/what-does-fields-refer-to-in-kibana-discover-json-view/366776/2 "2024-09-19T09:28:41Z")

</div>

Hi @ACoder,

Discover is using `fields` option when requesting data from Elasticsearch instead of searching from `_source`. More info on that API in [Retrieve selected fields from a search | Elasticsearch Guide [8.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html)

Do you have these fields in `_source` object in the JSON view?

What index pattern is configured for the current Data View? It could be that more than one index is targeted during the Discover search request hence more fields are requested.

---

<div class="post-metadata">

**Author:** ![ACoder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/acoder/32/113449_2.png) [@ACoder](https://discuss.elastic.co/u/ACoder)\
**Post date:** [September 20, 2024, 7:28am UTC](https://discuss.elastic.co/t/what-does-fields-refer-to-in-kibana-discover-json-view/366776/3 "2024-09-20T07:28:48Z")

</div>

> [@jughosta](#):
>
> Do you have these fields in `_source` object in the JSON view?

Yes

> [@jughosta](#):
>
> What index pattern is configured for the current Data View?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/6/96e50004d6d16606025fe3c39e3acbd4b960a8f5.png)  
There are some fields starting with "lesson.\*", but doesn't appear in `mappings`, they do exist in `_source` in JSON view.

Following is what I got when using the API directly in Dev Tools/Console:

```auto
POST course-api-study-records/_search
{
  "query": {
    "match_all": {}
  },
  "fields": [
    "*"
  ], 
  "_source": false
}

```

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/f/7f115be0899a65385b3b3f47c485e21093a043c9.png)

---

<div class="post-metadata">

**Author:** ![jughosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jughosta/32/107160_2.png) [@jughosta](https://discuss.elastic.co/u/jughosta)\
**Post date:** [September 20, 2024, 7:49am UTC](https://discuss.elastic.co/t/what-does-fields-refer-to-in-kibana-discover-json-view/366776/4 "2024-09-20T07:49:50Z")

</div>

In Discover requests we also pass `include_unmapped`. Can you try it in DevTools?

```auto
"fields": [
    {
      "field": "*",
      "include_unmapped": true
    }
  ]

```

> **[Retrieve selected fields from a search | Elasticsearch Guide \[8.15\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-fields.html#retrieve-unmapped-fields)**
