# Elasticsearch query shows more count than it has

**URL:** <https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897>\
**Category:** Elasticsearch\
**Created:** [July 17, 2019, 7:15am UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897 "2019-07-17T07:15:40Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmet\_Kartal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmet_kartal/32/47196_2.png) [@Ahmet\_Kartal](https://discuss.elastic.co/u/Ahmet_Kartal)\
**Post date:** [July 17, 2019, 7:15am UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897/1 "2019-07-17T07:15:40Z")

</div>

In one of my field I have "xr" data and "xra","xrb","xrc" separetely. When I make query of the count of "xr" it says I have 4 data. But I expect from elasticsearch to say 1. What do I need to change?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 17, 2019, 8:12am UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897/2 "2019-07-17T08:12:02Z")

</div>

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

---

<div class="post-metadata">

**Author:** ![Ahmet\_Kartal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmet_kartal/32/47196_2.png) [@Ahmet\_Kartal](https://discuss.elastic.co/u/Ahmet_Kartal)\
**Post date:** [July 17, 2019, 8:25am UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897/3 "2019-07-17T08:25:35Z")

</div>

This is my query:

```auto
"aggs": {
                "Group1": {
                    "terms": {
                        "field": "method.keyword",
                        "include": ".*POST.*",
                    },
                    "aggs": {
                        "Group3": {
                            "terms": {
                                "field": "contains.keyword",
                                "size": 11593,

                            }
                        }

                    },

                        }

```

This is my mapping : [https://paste.ubuntu.com/p/v5KjB8NqHf/](https://paste.ubuntu.com/p/v5KjB8NqHf/)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 17, 2019, 8:47am UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897/4 "2019-07-17T08:47:11Z")

</div>

Did you read [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21)?

I can't reproduce anything here.

---

<div class="post-metadata">

**Author:** ![Ahmet\_Kartal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmet_kartal/32/47196_2.png) [@Ahmet\_Kartal](https://discuss.elastic.co/u/Ahmet_Kartal)\
**Post date:** [July 17, 2019, 8:51am UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897/5 "2019-07-17T08:51:25Z")

</div>

I read sir but I use this query on python-elasticsearch library. Do you know how can I provide that information. I have no idea.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 17, 2019, 9:04am UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897/6 "2019-07-17T09:04:32Z")

</div>

> Do you know how can I provide that information?

Sure.

- Start kibana.
- Open the Dev Console.
- Write a similar script as I shared which reproduces your problem.
- Once you have reproduced the problem, share the script here. Then from this point we can surely help.

---

<div class="post-metadata">

**Author:** ![Ahmet\_Kartal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmet_kartal/32/47196_2.png) [@Ahmet\_Kartal](https://discuss.elastic.co/u/Ahmet_Kartal)\
**Post date:** [July 17, 2019, 10:06am UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897/7 "2019-07-17T10:06:20Z")

</div>

It gives "[10:22:14.309] [warning][task\_manager] PollError [illegal\_argument\_exception] Malformed [mappings] section for type [dynamic], should include an inner object describing the mapping  
" error. How can I solve it?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 17, 2019, 10:58am UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897/8 "2019-07-17T10:58:34Z")

</div>

I don't know what you did. Can't help to fix.  
At least share what you wrote.

---

<div class="post-metadata">

**Author:** ![Ahmet\_Kartal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahmet_kartal/32/47196_2.png) [@Ahmet\_Kartal](https://discuss.elastic.co/u/Ahmet_Kartal)\
**Post date:** [July 17, 2019, 11:12am UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897/9 "2019-07-17T11:12:05Z")

</div>

I just downloaded the kibana and started it with "./bin/kibana". I also changed the elasticsearch.host in kibana.yml ( I gave the address that I have my index). This error showed up.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 17, 2019, 12:06pm UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897/10 "2019-07-17T12:06:28Z")

</div>

I'd say that you mixed version may be? But really unsure as I know very little about your setup.

---

<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:** [August 14, 2019, 12:17pm UTC](https://discuss.elastic.co/t/elasticsearch-query-shows-more-count-than-it-has/190897/11 "2019-08-14T12:17:21Z")

</div>

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