LosD commented on a change in pull request #229: Upgrade to Elasticsearch 7.3.1
URL: https://github.com/apache/metamodel/pull/229#discussion_r338761602
 
 

 ##########
 File path: 
elasticsearch/rest/src/main/java/org/apache/metamodel/elasticsearch/rest/ElasticSearchRestUpdateCallback.java
 ##########
 @@ -135,20 +140,32 @@ public void execute(final ActionRequest action) {
 
     private void executeBlocking(final ActionRequest action) {
         try {
-            if (action instanceof PutMappingRequest) {
-                
getDataContext().getElasticSearchClient().createMapping((PutMappingRequest) 
action);
+            final RestHighLevelClient client = 
getDataContext().getRestHighLevelClient();
+            final ActionResponse result;
+
+            if (action instanceof BulkRequest) {
+                result = client.bulk((BulkRequest) action, 
RequestOptions.DEFAULT);
+            } else if (action instanceof IndexRequest) {
+                result = client.index((IndexRequest) action, 
RequestOptions.DEFAULT);
+            } else if (action instanceof DeleteRequest) {
+                result = client.delete((DeleteRequest) action, 
RequestOptions.DEFAULT);
+            } else if (action instanceof ClearScrollRequest) {
+                result = client.clearScroll((ClearScrollRequest) action, 
RequestOptions.DEFAULT);
+            } else if (action instanceof SearchScrollRequest) {
+                result = client.scroll((SearchScrollRequest) action, 
RequestOptions.DEFAULT);
 
 Review comment:
   That's... Rather nasty. It seems to do nothing, why is this needed?

----------------------------------------------------------------
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


With regards,
Apache Git Services

Reply via email to