# Different results between nest and kibana

**URL:** <https://discuss.elastic.co/t/different-results-between-nest-and-kibana/204251>\
**Category:** Elasticsearch\
**Created:** [October 18, 2019, 4:00pm UTC](https://discuss.elastic.co/t/different-results-between-nest-and-kibana/204251 "2019-10-18T16:00:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vic2](https://avatars.discourse-cdn.com/v4/letter/v/aca169/32.png) [@vic2](https://discuss.elastic.co/u/vic2)\
**Post date:** [October 18, 2019, 4:00pm UTC](https://discuss.elastic.co/t/different-results-between-nest-and-kibana/204251/1 "2019-10-18T16:00:38Z")

</div>

Hi,  
Here is a nest code:

```auto
        var request=new SearchRequest<Data>
                {
                    Aggregations = new AggregationDictionary
                    {
                        {
                            "exemple", new TermsAggregation("attribute"){
                                Field="attribute",
                                Size=100
                            }
                        }
                    },
                    Size=0
                };
        Console.WriteLine(client.RequestResponseSerializer.SerializeToString(request));
        return client.Search<Data>(request).Aggregations;

```

This is the request that is created and used by nest:

```auto
    {"aggs":{"exemple":{"terms":{"field":"attribute","size":100}}},"size":0}

```

When I use it in kibana i get the correct result:

```auto
    {
     "aggregations" : {
    "premier" : {
      "doc_count_error_upper_bound" : 0,
      "sum_other_doc_count" : 0,
      "buckets" : [
        {
          "key" : "com",
          "doc_count" : 413
        },
        {
          "key" : "fr",
          "doc_count" : 121
        },
        {
          "key" : "ru",
          "doc_count" : 109
        },
       ]
      }
      }
     }

```

when I use nest I get the same number of results in items but all the results are empty:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/7/d7a16bee5ef979d2a9d0b74419a0fb774f350185.png)

what's the reason for it?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 22, 2019, 8:28am UTC](https://discuss.elastic.co/t/different-results-between-nest-and-kibana/204251/2 "2019-10-22T08:28:34Z")

</div>

can you share the full query you are issuing in kibana and not only the result? The response you are pasted does not match with the query you mentioned, as the name of the aggregation differs - which should not have an impact on the result, but it still is a difference.

---

<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:** [November 19, 2019, 8:28am UTC](https://discuss.elastic.co/t/different-results-between-nest-and-kibana/204251/3 "2019-11-19T08:28:40Z")

</div>

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