CreateIndexRequest indexRequest = new CreateIndexRequest(indexName);
indexRequest.settings(Settings.builder().put("index.number_of_shards", 1));
String jsonst =
"{\n " +
" "properties" : {\n" +
" "syn": {\n" +
" "type": "text"\n" +
" }\n" +
" }\n" +
"}";
indexRequest.mapping(jsonst, XContentType.JSON);
CreateIndexResponse indexResponse = client.indices().create(indexRequest, RequestOptions.DEFAULT);
- error
mapping source must be pairs of fieldnames and properties definition.
What is the problem?