Module: ROM::Elasticsearch::Types

Includes:
Types
Defined in:
lib/rom/elasticsearch/types.rb

Overview

Elasticsearch types use by schema attributes

Constant Summary collapse

ID =

Default integer primary key

Integer.meta(primary_key: true)

Class Method Summary collapse

Class Method Details

.Keyword(meta = {}) ⇒ Dry::Types::Type

Define a keyword attribute type

Returns:

  • (Dry::Types::Type)


21
22
23
# File 'lib/rom/elasticsearch/types.rb', line 21

def self.Keyword(meta = {})
  String.meta(type: "keyword", **meta)
end

.Text(meta = {}) ⇒ Dry::Types::Type

Define a keyword attribute type

Returns:

  • (Dry::Types::Type)


30
31
32
# File 'lib/rom/elasticsearch/types.rb', line 30

def self.Text(meta = {})
  String.meta(type: "text", **meta)
end