ES创建索引问题

This commit is contained in:
daihh
2022-10-15 18:14:17 +08:00
parent bc8c88bb61
commit 5ac743b558

View File

@@ -126,6 +126,7 @@ public class CourseElasticsearchImpl implements ICourseFullTextSearch{
builder.endObject();
CreateIndexRequest createIndexRequest = new CreateIndexRequest(name);
createIndexRequest.settings(settingBuilder);
createIndexRequest.mapping(builder);
CreateIndexResponse createIndexResponse = restHighLevelClient.indices().create(createIndexRequest, RequestOptions.DEFAULT);
boolean acknowledged = createIndexResponse.isAcknowledged();