Skip to content

Commit

Permalink
refactor: rename updateIndexMapping in rest client
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Kao <[email protected]>
  • Loading branch information
seankao-az committed Mar 23, 2024
1 parent 7b8bb94 commit 05ebd93
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public interface IRestHighLevelClient extends Closeable {

CreateIndexResponse createIndex(CreateIndexRequest createIndexRequest, RequestOptions options) throws IOException;

void updateIndex(PutMappingRequest putMappingRequest, RequestOptions options) throws IOException;
void updateIndexMapping(PutMappingRequest putMappingRequest, RequestOptions options) throws IOException;

void deleteIndex(DeleteIndexRequest deleteIndexRequest, RequestOptions options) throws IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public CreateIndexResponse createIndex(CreateIndexRequest createIndexRequest, Re
}

@Override
public void updateIndex(PutMappingRequest putMappingRequest, RequestOptions options) throws IOException {
public void updateIndexMapping(PutMappingRequest putMappingRequest, RequestOptions options) throws IOException {
execute(OS_WRITE_OP_METRIC_PREFIX, () -> client.indices().putMapping(putMappingRequest, options));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void updateIndex(String indexName, FlintMetadata metadata) {
try (IRestHighLevelClient client = createClient()) {
PutMappingRequest request = new PutMappingRequest(osIndexName);
request.source(metadata.getContent(), XContentType.JSON);
client.updateIndex(request, RequestOptions.DEFAULT);
client.updateIndexMapping(request, RequestOptions.DEFAULT);
} catch (Exception e) {
throw new IllegalStateException("Failed to update Flint index " + osIndexName, e);
}
Expand Down

0 comments on commit 05ebd93

Please sign in to comment.