zjffdu commented on a change in pull request #4057:
URL: https://github.com/apache/zeppelin/pull/4057#discussion_r579724173



##########
File path: 
elasticsearch/src/main/java/org/apache/zeppelin/elasticsearch/client/HttpBasedClient.java
##########
@@ -254,6 +255,15 @@ public ActionResponse index(String index, String type, 
String id, String data) {
     return response;
   }
 
+  private long getTotal(HttpResponse<JsonNode> result) {
+    final JSONObject hitsObject = 
result.getBody().getObject().getJSONObject("hits");
+    try {
+      return hitsObject.getLong("total");
+    } catch (final JSONException ex) {
+      return hitsObject.getJSONObject("total").getLong("value");

Review comment:
       Could you add one comment to explain the backward compatibility logic 
here ?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to