# How to ignore a field from search if the field is not part of mappings?

**URL:** https://discuss.elastic.co/t/how-to-ignore-a-field-from-search-if-the-field-is-not-part-of-mappings/290228
**Category:** Elasticsearch
**Created:** [November 26, 2021, 4:28am UTC](https://discuss.elastic.co/t/how-to-ignore-a-field-from-search-if-the-field-is-not-part-of-mappings/290228 "2021-11-26T04:28:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Raghavan\_TV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raghavan_tv/32/97629_2.png) [@Raghavan\_TV](https://discuss.elastic.co/u/Raghavan_TV)
#### Post date: [November 26, 2021, 4:28am UTC](https://discuss.elastic.co/t/how-to-ignore-a-field-from-search-if-the-field-is-not-part-of-mappings/290228/1 "2021-11-26T04:28:00Z")

</div>

The document in elastic has field mappings only for the fields **catalog** and **@type**. now if a user sends an non-existing field ( **countryCode** ) in the search, is there a way in elastic to instruct to ignore the field in the search (even though its available in the request) ?

```auto
{
    "query": {
        "bool": {
            "must": [
                {
                    "query_string": {                       
                        "query": "(\\*catalog\\*:Trunk) AND (\\*@type\\*:Product) AND (\\*countryCode\\*:USA)"
                    }
                }
            ]
        }
    }
}

```

---

<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: [December 24, 2021, 4:28am UTC](https://discuss.elastic.co/t/how-to-ignore-a-field-from-search-if-the-field-is-not-part-of-mappings/290228/2 "2021-12-24T04:28:16Z")

</div>

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