esx v0.5.5 ESx.Model

Summary

Functions

config()
create_index(schema, opts \\ [])
delete_document(schema, opts \\ %{})
delete_index(schema, opts \\ [])
import(schema, opts \\ [])
index_document(schema, opts \\ %{})
index_exists?(schema, opts \\ [])
records(search)

See ESx.Model.Response.records/1.

records(search, queryable)

See ESx.Model.Response.records/2.

refresh_index(schema, opts \\ [])
reindex(schema, opts \\ [])
repo()
results(search)

See ESx.Model.Response.results/1.

search(queryable, query_or_payload, opts \\ [])

Search document from the data store matching the given query.

Options

  • :index - document index name in es
  • :type - document type name in es

Example

# Search 'my document' from elasticsearch
query = MyESx.search %{query: %{match: %{title: "my document"}}}

# Featch docuemnt from elasticsarch
MyESx.results query

# Featch docuemnt from elasticsarch as Record struct which contains [Ecto.Schema.t] records.
MyESx.records query
transport()