Sha256: 7e307a987767a0d2b2f3184f5f0c1a92b84cdfc5887497cfe44a06a418b0f6b5
Contents?: true
Size: 865 Bytes
Versions: 15
Compression:
Stored size: 865 Bytes
Contents
module RocketCMS::Search extend ActiveSupport::Concern included do if RocketCMS.mongoid? include Mongoid::Elasticsearch elasticsearch!({ index_options: { settings: { index: { analysis: { analyzer: { my_analyzer: { type: "snowball", language: "Russian" } } } } } }, index_mapings: { name: {type: 'string', boost: 10, analyzer: 'my_analyzer'}, content: {type: 'string', boost: 1, analyzer: 'my_analyzer'}, } }) else include PgSearch multisearchable against: [:name, :content] end def es_index? enabled end def as_indexed_json {name: name, content: SmartExcerpt.strip_tags(content)} end end end
Version data entries
15 entries across 15 versions & 1 rubygems