Sha256: db8f33d2f300563c98abed4af675f42705e610aa253d02dc026ae764743ff84d

Contents?: true

Size: 463 Bytes

Versions: 3

Compression:

Stored size: 463 Bytes

Contents

class Image
  include Mongoid::Document
  include Elasticsearch::Model
  include Elasticsearch::Model::Callbacks

  field :name, type: String
  attr_accessible :name if respond_to? :attr_accessible

  settings index: {number_of_shards: 1, number_of_replicas: 0} do
    mapping do
      indexes :name, type: 'text', analyzer: 'snowball'
      indexes :created_at, type: 'date'
    end
  end

  def as_indexed_json(options={})
    as_json(except: [:_id])
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elasticsearch-model-6.1.2 spec/support/app/image.rb
elasticsearch-model-6.1.1 spec/support/app/image.rb
elasticsearch-model-6.1.0 spec/support/app/image.rb