Skip to content

Commit

Permalink
Merge pull request #296 from peerplays-network/es_update1
Browse files Browse the repository at this point in the history
ES update1
  • Loading branch information
pbattu123 committed Feb 26, 2020
2 parents b7951e9 + 7f0bc33 commit 24e7610
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/plugins/elasticsearch/elasticsearch_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,13 @@ vector<operation_history_object> 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<uint32_t>(hits.as_uint64()), limit);
uint32_t size;
if( hits.is_object() ) // ES-7 ?
size = static_cast<uint32_t>(hits["value"].as_uint64());
else // probably ES-6
size = static_cast<uint32_t>(hits.as_uint64());

size = std::min( size, limit );

for(unsigned i=0; i<size; i++)
{
Expand Down

0 comments on commit 24e7610

Please sign in to comment.