Cannot create index with mappings settings
See original GitHub issueJava API client version
8.2.2
Java version
8
Elasticsearch Version
8.2.2
Problem description
The following code is expected to trigger an index creation in the target server. Instead, the error response below is received
RestClient restClient = RestClient.builder(new HttpHost("localhost", 9200)).build();
ElasticsearchTransport transport = new RestClientTransport(restClient, new JacksonJsonpMapper());
CreateIndexRequest request = new CreateIndexRequest.Builder().index("name")
.settings(s -> s.mappings(m -> m.totalFields(totalFields -> totalFields.limit(1001))))
.build();
new ElasticsearchClient(transport).indices().create(request);
Response:
[es/indices.create] failed: [illegal_argument_exception] unknown setting [index.mappings.total_fields.limit] did you mean any of …
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Create index API | Elasticsearch Guide [8.5] | Elastic
When creating an index, you can specify the following: Settings for the index; Mappings for fields in the index; Index aliases ...
Read more >Unknown key for create index - Common causes and quick fixes
Each index created can have specific settings, mapping definitions and index aliases. The above error arises when the request body of the create...
Read more >How to Create Elasticsearch Indices - Linux Hint
If you fail to specify any parameters, the index gets created using default configurations. Mappings: This defines the mapping for fields in the...
Read more >Error on creation of a mapping for an index - Stack Overflow
Because you are indexing data first into the index, Elasticsearch is auto-detecting the field type/mapping for your item_code field based on the data...
Read more >Elasticsearch Mapping Basics & Examples (After Create Index)
Here, we will delve deep into the Elasticsearch mappings using a stable Elasticsearch v2.4 configuration. We will discuss the basics, the different field...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is an issue in the API specification used to produce the Java code:
mappings
should bemapping
.The fix will be included in the next 8.x and 7.17.x releases.
In earlier versions, there was a clean api with which to load JSON mappings. It’s gone and, post 7, no documentation. Surely there is a way to load JSON mappings in recent versions.