Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Latest commit

 

History

History
66 lines (49 loc) · 2.25 KB

File metadata and controls

66 lines (49 loc) · 2.25 KB
code type title description
true
page
update
Update the collection mapping

update

You can define the collection dynamic mapping policy by setting the dynamic field to the desired value.

You can define collection additional metadata within the _meta root field.


  public CompletableFuture<Void> update(
      final String index,
      final String collection,
      final ConcurrentHashMap<String, Object> mapping)

Arguments Type Description
index
String
Index name
collection
String
Collection name
mapping
ConcurrentHashMap<String, Object>
Describes the collection mapping

mapping

A ConcurrentHashMap<String, Object> representing the collection data mapping.

It must have a root field properties that contain the mapping definition:

{
  mappings={
    dynamic="[true|false|strict]",
    _meta={
      field="value"
  },
    properties={
      field1={ type='text' },
      field2={
        properties={
          nestedField={ type='keyword' }
        }
      }
    }
  }
};

More information about database mappings here.

Returns

Returns a CompletableFuture<Void>.

Usage

<<< ./snippets/update.java