# Help with \`docCount\`

**URL:** <https://discuss.elastic.co/t/help-with-doccount/257894>\
**Category:** Elasticsearch\
**Created:** [December 7, 2020, 6:57pm UTC](https://discuss.elastic.co/t/help-with-doccount/257894 "2020-12-07T18:57:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiagokalinke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagokalinke/32/80381_2.png) [@tiagokalinke](https://discuss.elastic.co/u/tiagokalinke)\
**Post date:** [December 7, 2020, 6:57pm UTC](https://discuss.elastic.co/t/help-with-doccount/257894/1 "2020-12-07T18:57:55Z")

</div>

Hi. I am using the Explain API to understand the relevance of a result. However, for each request the `docCount` is varying.

```auto
    {
        "size": 6,
        "query": {
            "bool": {
                "must": [
                    {
                        "function_score": {
                            "query": {
                                "bool": {
                                    "should": [
                                        {
                                            "multi_match": {
                                                "type": "most_fields",
                                                "query": "roma",
                                                "fields": [
                                                    "canonicalName",
                                                    "keywords",
                                                    "name",
                                                    "code"
                                                ],
                                                "boost": 1,
                                                "operator": "and"
                                            }
                                        },
                                        {
                                            "multi_match": {
                                                "type": "phrase",
                                                "query": "roma",
                                                "fields": [
                                                    "name",
                                                    "canonicalName"
                                                ],
                                                "boost": 1,
                                                "operator": "and"
                                            }
                                        },
                                        {
                                            "multi_match": {
                                                "type": "phrase_prefix",
                                                "query": "roma",
                                                "max_expansions": 100,
                                                "fields": [
                                                    "keywords",
                                                    "name",
                                                    "canonicalName"
                                                ],
                                                "boost": 1,
                                                "operator": "and"
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    }
                ],
                "must_not": [],
                "filter": []
            }
        }
    }

```

How does the calculation of this field work?

I'm using only one shard.

---

<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:** [January 4, 2021, 6:58pm UTC](https://discuss.elastic.co/t/help-with-doccount/257894/2 "2021-01-04T18:58:00Z")

</div>

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