mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-06 17:36:47 +08:00
fix: 修正索引添加
This commit is contained in:
@@ -142,8 +142,11 @@ public class ElasticSearchIndexServiceImpl implements IElasticSearchIndexService
|
||||
JSONObject newField = new JSONObject();
|
||||
newField.put(fieldName, fieldProperties);
|
||||
|
||||
JSONObject properties = new JSONObject();
|
||||
properties.put("properties", newField);
|
||||
|
||||
PutMappingRequest request = new PutMappingRequest(CaseAiConstants.CASE_AI_INDEX_NAME);
|
||||
request.source(newField.toJSONString(), XContentType.JSON);
|
||||
request.source(properties.toJSONString(), XContentType.JSON);
|
||||
try {
|
||||
AcknowledgedResponse response = elasticsearchClient.indices().putMapping(request, RequestOptions.DEFAULT);
|
||||
if (response.isAcknowledged()) {
|
||||
|
||||
Reference in New Issue
Block a user