Elastic v3.5.0 Elastic.Index View Source
Collection of functions to work with indices.
Link to this section Summary
Functions
Closes the specified index
Creates the specified index.
If you've configured index_prefix and use_mix_env for Elastic, it will use those
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
Deletes the specified index.
If you've configured index_prefix and use_mix_env for Elastic, it will use those
Checks if the specified index exists. The index name will be automatically prefixed as per this package's configuration
Helper function for getting the name of an index combined with the
index_prefix and mix_env configuration
Opens the specified index
Refreshes the specified index by issuing a refresh HTTP call
Link to this section Functions
close(index) View Source
Closes the specified index.
create(index) View Source
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")
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}})
delete(index) View Source
Deletes 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 delete the `elastic_dev_answer` index
Elastic.Index.delete("answer")
exists?(index) View Source
Checks if the specified index exists. The index name will be automatically prefixed as per this package's configuration.
name(index) View Source
Helper function for getting the name of an index combined with the
index_prefix and mix_env configuration.
open(index) View Source
Opens the specified index.
refresh(index) View Source
Refreshes the specified index by issuing a refresh HTTP call.