You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2022/09/21 15:08:17 UTC

[GitHub] [jackrabbit-oak] fabriziofortino commented on a diff in pull request #709: OAK-9945 - Migrate index creation from Rest High Level Client to the new Java API Client

fabriziofortino commented on code in PR #709:
URL: https://github.com/apache/jackrabbit-oak/pull/709#discussion_r976628273


##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java:
##########
@@ -158,24 +159,23 @@ private void saveMetrics() {
     }
 
     private void provisionIndex() throws IOException {
-        ElasticsearchIndicesClient client = elasticConnection.getClient().indices();
+        final ElasticsearchIndicesClient esClient = elasticConnection.getClient().indices();
         // check if index already exists
-        if(client.exists(i -> i.index(indexName)).value()) {
+        if (esClient.exists(i -> i.index(indexName)).value()) {
             LOG.info("Index {} already exists. Skip index provision", indexName);
             return;
         }
 
-        // create the new index
         final CreateIndexRequest request = ElasticIndexHelper.createIndexRequest(indexName, indexDefinition);
+        if (LOG.isDebugEnabled()) {
+            StringBuilder sb = new StringBuilder();
+            JsonpUtils.toString(request,sb);

Review Comment:
   minor, missing space
   ```suggestion
               JsonpUtils.toString(request, sb);
   ```



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

To unsubscribe, e-mail: dev-unsubscribe@jackrabbit.apache.org

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