View Source ElasticsearchEx.Serializer (Elasticsearch_ex v1.6.0)

Converts a document or source from Elixir data structures into data structures compatible with Elasticsearch.

An example is the convertion of Range or Date.Range into %{"gte" => first, "lte" => last}.

Summary

Types

Represents the Elasticsearch mappings which is represented by a Map with keys as String.

Represents a list/stream of documents, a document, a document source or any values.

Functions

Serialize a list of documents, a document or a document source.

Types

@type mappings() :: %{required(binary()) => any()}

Represents the Elasticsearch mappings which is represented by a Map with keys as String.

@type value() :: Enumerable.t() | %{required(binary()) => any()}

Represents a list/stream of documents, a document, a document source or any values.

Functions

Link to this function

serialize(value, mappings)

View Source
@spec serialize(value(), mappings()) :: value()

Serialize a list of documents, a document or a document source.

Stream is also accepted and returns a Stream.