elasticsearch v0.3.0 Elasticsearch.Store behaviour View Source
A behaviour for fetching data to index. Used by mix elasticsearch.build
.
Link to this section Summary
Types
Instances of the data source. For example, %Post{}
structs
A limit on the number of elements to return
The current offset for the query
A data source. For example, Post
, where Post
is an Ecto.Schema
.
Each datum returned must implement Elasticsearch.Document
Callbacks
Loads data based on the given source, offset, and limit
Link to this section Types
Instances of the data source. For example, %Post{}
structs.
A limit on the number of elements to return.
The current offset for the query.
A data source. For example, Post
, where Post
is an Ecto.Schema
.
Each datum returned must implement Elasticsearch.Document
.
Link to this section Callbacks
Loads data based on the given source, offset, and limit.
Example
def load(Post, offset, limit) do
Post
|> offset(^offset)
|> limit(^limit)
|> Repo.all()
end