commit
24e7610bce
1 changed files with 7 additions and 1 deletions
|
|
@ -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++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue