Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the mapping of an index #2917

Open
gaelayo opened this issue Sep 13, 2023 · 1 comment
Open

Update the mapping of an index #2917

gaelayo opened this issue Sep 13, 2023 · 1 comment

Comments

@gaelayo
Copy link
Contributor

gaelayo commented Sep 13, 2023

Hello, and thank you for the library.

I am trying to find documentation about how to update the mapping of an index (similar to https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html#put-mapping-api-prereqs ), but I can only find the rollover method and createIndex.

Edit: I also found the class PutMappingRequest, but it does not seem to take a MappingDefinition as argument. Is it possible to convert a MappingDefinition into a PutMappingRequest ?

Thank you

@gaelayo gaelayo changed the title Update an index Update the mapping of an index Sep 13, 2023
@tastyminerals
Copy link

Have you tried?

 def putIndexMapping(indexName: String, mapping: MappingDefinition): Unit = {
    client.execute {
      putMapping(Seq(indexName)).properties(mapping.properties)
    }.await(timeout)
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants