debian-mirror-gitlab/elasticsearch-model/spec/support/app/import_article.rb
2020-03-13 15:44:24 +05:30

12 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