# X\_content\_parse\_exception

**URL:** <https://discuss.elastic.co/t/x-content-parse-exception/350381>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [January 4, 2024, 12:19pm UTC](https://discuss.elastic.co/t/x-content-parse-exception/350381 "2024-01-04T12:19:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![redk1te](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redk1te/32/130559_2.png) [@redk1te](https://discuss.elastic.co/u/redk1te)\
**Post date:** [January 4, 2024, 12:19pm UTC](https://discuss.elastic.co/t/x-content-parse-exception/350381/1 "2024-01-04T12:19:23Z")

</div>

Hi,  
I get the x\_content\_parse\_exception error with the next query.  
"reason": "[10:13] [bool] unknown field [wildcard]"

without the "bool" section I get the error:  
"reason": "unknown query [must\_not]"

Any suggestions why?

```auto
{
    "size": 5000,
    "query": {
        "bool": {
            "must_not": {
                "exists": {
                    "field": "status"
                }
            },
            "wildcard": {
                "type": {
                    "value": "Activity_*"
                }
            }
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [January 4, 2024, 1:42pm UTC](https://discuss.elastic.co/t/x-content-parse-exception/350381/2 "2024-01-04T13:42:52Z")

</div>

Hey there @redk1te , [boolean queries](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html) only support `must`, `filter`, `should` and `must_not` as top level parameters, each of which can hold one or more queries. You should use `one of these (depending on what you need for your use case) and include your wildcard query as a query underneath that clause.

Here's an example of what that would look like:

```auto
{
  "size": 5000,
  "query": {
    "bool": {
      "must_not": {
        "exists": {
          "field": "status"
        }
      },
      "must": [
        {
          "wildcard": {
            "type": {
              "value": "Activity_*"
            }
          }
        }
      ]
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![redk1te](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redk1te/32/130559_2.png) [@redk1te](https://discuss.elastic.co/u/redk1te)\
**Post date:** [January 5, 2024, 8:42am UTC](https://discuss.elastic.co/t/x-content-parse-exception/350381/3 "2024-01-05T08:42:06Z")

</div>

Hi Kathleen  
That did the trick. Thank you for elaborating.  
I keep having a hard time finding these rules in the standard Elasticsearch help pages. Especially about combining queries.  
Is there any other place where I could have found this?

---

<div class="post-metadata">

**Author:** ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)\
**Post date:** [January 5, 2024, 1:35pm UTC](https://discuss.elastic.co/t/x-content-parse-exception/350381/4 "2024-01-05T13:35:18Z")

</div>

Thanks for the feedback @redk1te - in this particular case we have [Boolean Query DSL documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html) that provides examples, though the examples are intentionally pretty simple for illustrative sake (term queries).

If there is something that could be clearer, though, feedback is always appreciated to improve!

---

<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:** [February 2, 2024, 1:35pm UTC](https://discuss.elastic.co/t/x-content-parse-exception/350381/5 "2024-02-02T13:35:20Z")

</div>

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