Different results between nest and kibana

Hi,
Here is a nest code:

        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:

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

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

    {
     "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

what's the reason for it?

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.

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