Sha256: 270d97370a9c74b8881ed7005af6c8c263f7d3fd7d695874898629652a65bdf9
Contents?: true
Size: 805 Bytes
Versions: 3
Compression:
Stored size: 805 Bytes
Contents
class Article include Mongoid::Document include Mongoid::Timestamps::Short include ActiveModel::ForbiddenAttributesProtection field :name include Mongoid::Slug slug :name field :tags include Mongoid::Elasticsearch i_fields = { name: {type: 'string', analyzer: 'snowball'}, raw: {type: 'string', index: :not_analyzed}, _slugs: {type: 'string', index: :not_analyzed} } if Gem::Version.new(::Elasticsearch::Client.new.info['version']['number']) > Gem::Version.new('0.90.2') i_fields[:suggest] = {type: 'completion'} end elasticsearch! index_name: 'mongoid_es_news', prefix_name: false, index_mappings: { name: { type: 'multi_field', fields: i_fields }, tags: {type: 'string', include_in_all: false} }, wrapper: :load end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mongoid-elasticsearch-0.3.3 | spec/models/article.rb |
mongoid-elasticsearch-0.3.2 | spec/models/article.rb |
mongoid-elasticsearch-0.3.1 | spec/models/article.rb |