debian-mirror-gitlab/elasticsearch-rails/elasticsearch-model/spec/support/app/import_article.rb

13 lines
300 B
Ruby
Raw Normal View History

2020-03-13 15:44:24 +05:30
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