Elastic.Index.create

You're seeing just the function create, go back to Elastic.Index module for more information.

Creates the specified index. If you've configured index_prefix and use_mix_env for Elastic, it will use those.

Examples

# With index_prefix set to 'elastic'
# And with `use_mix_env` set to `true`
# This will create the `elastic_dev_answer` index
Elastic.Index.create("answer")
Link to this function

create(index, parameters)

View Source

Creates the specified index with optional configuration parameters like settings, mappings, aliases (see the ES Indices API documentation for information on what you can pass). If you've configured index_prefix and use_mix_env for Elastic, it will use those.

Examples

# With index_prefix set to 'elastic'
# And with `use_mix_env` set to `true`
# This will create the `elastic_dev_answer` index
Elastic.Index.create("answer", %{settings: {number_of_shards: 2}})