# Elasticsearch better settings, mapping and queries to match with regular and nested fields

**URL:** <https://discuss.elastic.co/t/elasticsearch-better-settings-mapping-and-queries-to-match-with-regular-and-nested-fields/312475>\
**Category:** Elasticsearch\
**Tags:** eql-elastic-query-language\
**Created:** [August 19, 2022, 2:28pm UTC](https://discuss.elastic.co/t/elasticsearch-better-settings-mapping-and-queries-to-match-with-regular-and-nested-fields/312475 "2022-08-19T14:28:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![babuzrb](https://avatars.discourse-cdn.com/v4/letter/b/bcef8e/32.png) [@babuzrb](https://discuss.elastic.co/u/babuzrb)\
**Post date:** [August 19, 2022, 2:28pm UTC](https://discuss.elastic.co/t/elasticsearch-better-settings-mapping-and-queries-to-match-with-regular-and-nested-fields/312475/1 "2022-08-19T14:28:25Z")

</div>

I have multi level nested list of objects along with regular fields to index in elasticsearch. For example here is a document:

```auto
{
 "main_field_1" : {
     "level_1" : [
        "inner_level_1_field_1": "test-2",
        "inner_level_1_field_2": "test-2",
        "inner_level_1_field_3": [
              "level_2": {
                  "level_2_field_1": "TEST-2",
                   "level_2_field_2": "Test-2",
                   "level_2_field_3": .............
               }
        ]
  ],
  "main_field_2": "test 2",
   .................
}
}

```

Can you please suggest a better settings/analyzer, mapping and query plan for this index so that when I will search by either "test-2" or "test 2" or "test2" or "Test 2" over all the mentioned fields here, i will get this (and all other matched) document(s) in response? I am using Elasticsearch version 7.17.5

Thank You

---

<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:** [September 16, 2022, 2:29pm UTC](https://discuss.elastic.co/t/elasticsearch-better-settings-mapping-and-queries-to-match-with-regular-and-nested-fields/312475/2 "2022-09-16T14:29:15Z")

</div>

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