question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot create index with mappings settings

See original GitHub issue

Java 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:closed
  • Created a year ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
swallezcommented, Jun 23, 2022

This is an issue in the API specification used to produce the Java code: mappings should be mapping.

The fix will be included in the next 8.x and 7.17.x releases.

1reaction
KnowledgeGardencommented, Jun 11, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found