# Cannot query nested field

**URL:** https://discuss.elastic.co/t/cannot-query-nested-field/225597
**Category:** Kibana
**Created:** [March 29, 2020, 10:50pm UTC](https://discuss.elastic.co/t/cannot-query-nested-field/225597 "2020-03-29T22:50:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![omgeng](https://avatars.discourse-cdn.com/v4/letter/o/57b2e6/32.png) [@omgeng](https://discuss.elastic.co/u/omgeng)
#### Post date: [March 29, 2020, 10:50pm UTC](https://discuss.elastic.co/t/cannot-query-nested-field/225597/1 "2020-03-29T22:50:30Z")

</div>

Halo,

I am using elastic cloud ELK. I have created an index with a mapping containing several nested fields. I checked on Kibana and it looks fine. However when I try to write a query in KQL for the nested field, it does not behave the way it should. According to this [merge request](https://github.com/elastic/kibana/pull/47070), and the screenshot below, the autocomplete suggestion should start suggesting a nested syntax while I start to type in the nested field, but it didn't.

[https://user-images.githubusercontent.com/6239176/65991057-b9fbfe80-e45a-11e9-907c-827bb2c6e453.gif(image larger than 4096KB)](https://user-images.githubusercontent.com/6239176/65991057-b9fbfe80-e45a-11e9-907c-827bb2c6e453.gif)

My index mapping shown in Kibana is as this:

```auto
> "field_1": {
> "type": "nested",
> "properties": {
> "sub-field_1": {
> "type": "text",
> "fields": {
> "keyword": {
> "type": "keyword",
> "ignore_above": 256
> }
> }
> },
> "sub-field_2": {
> "type": "text",
> "fields": {
> "keyword": {
> "type": "keyword",
> "ignore_above": 256
> }
> }
> },

```

Also I have tried querying the sub-field directly with a wildcard search, like `field_1.sub-field_1: *`, but not a single result returned.

Does anyone know what went wrong? Thanks!

---

<div class="post-metadata">

### Author: ![mikecote](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikecote/32/58549_2.png) [@mikecote](https://discuss.elastic.co/u/mikecote)
#### Post date: [March 30, 2020, 7:42pm UTC](https://discuss.elastic.co/t/cannot-query-nested-field/225597/2 "2020-03-30T19:42:45Z")

</div>

Hi @omgeng,

This mapping seems to work for me by providing suggestions in the Discover app.

Can you provide the following?

- Kibana version
- Are you using an index pattern?
- Sample data

---

<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 27, 2020, 7:46pm UTC](https://discuss.elastic.co/t/cannot-query-nested-field/225597/3 "2020-04-27T19:46:19Z")

</div>

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