# Nested fields are being indexed but are no longer searchable in Discover

**URL:** https://discuss.elastic.co/t/nested-fields-are-being-indexed-but-are-no-longer-searchable-in-discover/327913
**Category:** Kibana
**Tags:** docker, language-clients, discover
**Created:** [March 17, 2023, 9:32am UTC](https://discuss.elastic.co/t/nested-fields-are-being-indexed-but-are-no-longer-searchable-in-discover/327913 "2023-03-17T09:32:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Raspberry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raspberry/32/118563_2.png) [@Raspberry](https://discuss.elastic.co/u/Raspberry)
#### Post date: [March 17, 2023, 9:32am UTC](https://discuss.elastic.co/t/nested-fields-are-being-indexed-but-are-no-longer-searchable-in-discover/327913/1 "2023-03-17T09:32:29Z")

</div>

I have the following index mappings that I set up from PHP.

```auto
"index" => "my-index-name",
"body" => [
    "settings" => [
        "number_of_replicas" => 0,
        "number_of_shards" => 1,
    ],
    "mappings" => [
        "_source" => [
            "enabled" => true,
        ],
        "properties" => [
            "@timestamp" => [
                "type" => "date",
            ],
            "status" => [
                "type" => "keyword",
            ],
            "os" => [
                "type" => "keyword",
            ],
            "ip" => [
                "type" => "ip",
            ],
            "action" => [
                "type" => "keyword",
            ],
            "userEmail" => [
                "type" => "text",
            ],
            "userId" => [
                "type" => "integer",
            ],
            "acceptedAt" => [
                "type" => "date",
                "format" => "yyyy-MM-dd HH:mm:ss",
            ],
            "processedAt" => [
                "type" => "date",
                "format" => "yyyy-MM-dd HH:mm:ss",
            ],
            "acceptedData" => [
                "type" => "nested",
            ],
            "returnedData" => [
                "type" => "nested",
            ],
            "appVersion" => [
                "type" => "version",
            ],
        ],
    ],
],

```

At first the "nested" type fields were available in Discover to search and I was able to create Lens visualizations using these fields.

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

I had to restart the ELK docker stack and now none if these fields are searchable and Lens no longer see them.

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

In Discover section they seem like they are empty

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/6/069e1dced7ded98d5d1a9a5bd07ff3fa01fc3b0e.png)

but as you can see, these nested objects/fields are indeed not empty

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/2/0243395862fc0593dfcf858cdbb6b2358e093499.png)

I tried to recreate whole Index and Index pattern, but that did not help. I have no idea what is going on. Any tips?

---

<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: [March 20, 2023, 9:59am UTC](https://discuss.elastic.co/t/nested-fields-are-being-indexed-but-are-no-longer-searchable-in-discover/327913/2 "2023-03-20T09:59:55Z")

</div>

Hi @Raspberry,

Welcome to the community!

What version are you using?

From v7.12 Kibana now uses Fields API when fetching documents on Discover page. Please read more about it and how it affects nested fields representation in the following article:

> **[Discover uses the fields API in 7.12](https://www.elastic.co/de/blog/discover-uses-fields-api-in-7-12)**
>
> To improve the simplicity of retrieving fields, Discover in Kibana now uses the fields API by default. Learn more about how you can benefit from the new search parameter.

---

<div class="post-metadata">

### Author: ![Raspberry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raspberry/32/118563_2.png) [@Raspberry](https://discuss.elastic.co/u/Raspberry)
#### Post date: [March 20, 2023, 11:51am UTC](https://discuss.elastic.co/t/nested-fields-are-being-indexed-but-are-no-longer-searchable-in-discover/327913/3 "2023-03-20T11:51:52Z")

</div>

Hi, I am using still the same version - 7.16.3 No upgrade was done.

---

<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: [April 17, 2023, 11:52am UTC](https://discuss.elastic.co/t/nested-fields-are-being-indexed-but-are-no-longer-searchable-in-discover/327913/4 "2023-04-17T11:52:13Z")

</div>

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