koleksiuk/dry-elastic_model

View on GitHub
bin/console

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby

require "bundler/setup"
require "dry/elastic_model"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)

class Foo < Dry::ElasticModel::Base
  field :text_field, :text, index: false
  field :keyword_field, :keyword
  field :date_field, :date
  field :long_field, :long
  field :double_field, :double
  field :boolean_field, :boolean
  field :ip_field, :ip
end

class Bar < Dry::ElasticModel::Base
  field :field, :object
end

class FooList < Dry::ElasticModel::Base
  list :list_text_field, :text
end

class FooRange < Dry::ElasticModel::Base
  range :range_long_field, :long
end

require "pry"
Pry.start