question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting empty objects in json after serialzing DateHistogram Aggregation object from SearchTemplateAsync response

See original GitHub issue

NEST Version : 6.0.1 Elastic Version : 6.X

Description : I am gettting response from Elastic for my search template. However, after serialzing those response to json, I am getting empty objects for hits and aggregation (DateHistogram).

Steps to reproduce :

Getting response from elastic for below query but there are empty object in json after serialzing the response-

    {
      "size": 100,
      "query": {
        "constant_score": {
          "filter": {
            "bool": {
              "must": [
                {
                  "term": {
                    "id": "2"
                  }
                }
              ]
            }
          }
        }
      },
      "aggs": {
        "CountHistory": {
          "date_histogram": {
            "field": "abc",
            "interval": "60m",
            "min_doc_count": 0,
            "extended_bounds": {
              "min": "2018-02-03",
              "max": "2018-02-012"
            }
          }
        }
      }
    }

NOTE : Serialzation is working fine with NEST 5.X versions.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:27 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
Mpdreamzcommented, Aug 1, 2018

Closing this due to inactivity and the suggested solutions are good workarounds in my opinion.

1reaction
russcamcommented, Feb 16, 2018

@anuragdewangan20 Just so I understand the issue correctly, could you confirm that this is what you’re doing:

  1. Making a request to Elasticsearch that includes a Date Histogram aggregation
  2. Receiving the response from Elasticsearch, with JSON being correctly deserialized into the MultiBucketAggregate<DateHistogramBucket> for the Date Histogram aggregation
  3. Reserializing the ISearchResponse<T> back into JSON within the application for another purpose.

Is that correct?

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Key" and "docCount" are missing when serializing ...
I have a bucket aggregate that in v5 serializes to this: "items": ... [Getting empty objects in json after serialzing DateHistogram ...
Read more >
Empty Elasticsearch aggregations being returned in the ...
im confused as to why my response object has all the data but it just isn't being returned in the http response i...
Read more >
Match query for json object mongodb data returning empty ...
I want to get data of user by searching name. So I'm using aggregate method and then using match operator to achieve it....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found