Sha256: 5e4eef8ecc377ec67074644d8e8982ecf8435fe768e95d25df3d2ddf0da63ad2

Contents?: true

Size: 300 Bytes

Versions: 3

Compression:

Stored size: 300 Bytes

Contents

class ImportArticle < ActiveRecord::Base
  include Elasticsearch::Model

  scope :popular, -> { where('views >= 5') }

  mapping do
    indexes :title,      type: 'text'
    indexes :views,      type: 'integer'
    indexes :numeric,    type: 'integer'
    indexes :created_at, type: 'date'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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