debian-mirror-gitlab/elasticsearch-rails/elasticsearch-model/spec/support/app/import_article.rb
2021-03-05 16:19:46 +05:30

13 lines
300 B
Ruby

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