exlasticsearch v1.10.1 ExlasticSearch.Repo View Source
API executor for elasticsearch. The generate pattern is to define a ExlasticSearch.Model
on an ecto model, then call any of these functions to manage the model.
To configure the url the repo points to, do:
config :exlasticsearch, ExlasticSearch.Repo,
url: "https://elasticsearch.url.io:9200"
Link to this section Summary
Functions
Performs an aggregation against a query, and returns only the aggregation results
Generates an Elasticsearch bulk request. operations
should be of the form
Close an index for model
Aliases one index version to another, for instance
Creates an index as defined in model
Updates an index’s mappings to the current definition in model
Removes struct
from the index of its model
Removes the index defined in model
Checks if the index for model
exists
Gets an ES document by _id
Retries the aliases for a given index
Adds a struct into it’s associated index. The struct will be passed through the ExlasticSearch.Indexable
protocol prior to insertion
open an index for model
Refreshes model
’s index
Deletes the read index and aliases the write index to it
Creates a call to search/3
by realizing query
(using Exlasticsearch.Query.realize/1
) and any provided search opts
Searches the index and type associated with model
according to query search
Updates the document of the passed in id for the index associated to the model
Updates the index for model
Updates a nested field of the document of the passed in id for the index associated to the model
Link to this section Types
Link to this section Functions
Performs an aggregation against a query, and returns only the aggregation results.
Generates an Elasticsearch bulk request. operations
should be of the form:
Note: the last element in each Tuple is optional and will default to :index
[
{:index, struct, index},
{:delete, other_struct, index},
{:update, third_struct, id, map, index},
{:nested, id, source, map, index}
]
The function will handle formatting the bulk request properly and passing each
struct to the ExlasticSearch.Indexable
protocol
Close an index for model
Aliases one index version to another, for instance:
alias(MyModel, read: :index)
will create an alias of the read version of the model’s index against it’s indexing version
Creates an index as defined in model
Updates an index’s mappings to the current definition in model
Removes struct
from the index of its model
Removes the index defined in model
Checks if the index for model
exists
Gets an ES document by _id
Retries the aliases for a given index
Adds a struct into it’s associated index. The struct will be passed through the ExlasticSearch.Indexable
protocol prior to insertion
open an index for model
paginate(any(), map() | Keyword.t()) :: Scrivener.Page.t()
Refreshes model
’s index
Deletes the read index and aliases the write index to it
search(ExlasticSearch.Query.t(), list()) :: response()
Creates a call to search/3
by realizing query
(using Exlasticsearch.Query.realize/1
) and any provided search opts
Searches the index and type associated with model
according to query search
Updates the document of the passed in id for the index associated to the model
Updates the index for model
Updates a nested field of the document of the passed in id for the index associated to the model.
the source param is the script you want to apply for the update.