From 7f0bc332be0c2e91f25b63f0c18cd84a861cad60 Mon Sep 17 00:00:00 2001
From: pbattu123
Date: Wed, 26 Feb 2020 12:41:22 -0400
Subject: [PATCH] update to es plugin
---
libraries/plugins/elasticsearch/elasticsearch_plugin.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp
index 96dbab7c6..484aef9cf 100644
--- a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp
+++ b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp
@@ -561,7 +561,13 @@ vector elasticsearch_plugin::get_account_history(
variant variant_response = fc::json::from_string(response);
const auto hits = variant_response["hits"]["total"]["value"];
- const auto size = std::min(static_cast(hits.as_uint64()), limit);
+ uint32_t size;
+ if( hits.is_object() ) // ES-7 ?
+ size = static_cast(hits["value"].as_uint64());
+ else // probably ES-6
+ size = static_cast(hits.as_uint64());
+
+ size = std::min( size, limit );
for(unsigned i=0; i