Sha256: 9c3115966b3c86ae54d33cc6869032f32d9b140101c7f07127568ea224ff7300

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

require 'active_support/concern'

module Georgia
  module Indexer
    module SolrAdapter
      module GeorgiaMailerMessageExtension
        extend ActiveSupport::Concern

        included do

          searchable do
            text :name
            text :email
            text :message
            text :subject
            text :phone
            string :spam do
              status
            end
            string :name
            string :email
            string :phone
            string :subject
            string :message
            time :created_at
          end

          def self.search_index model, params
            search do
              fulltext params[:query] do
                fields(:name, :email, :message, :subject, :phone)
              end
              facet :spam
              with(:spam, (params[:s] || 'clean'))
              order_by (params[:o] || :created_at), (params[:dir] || :desc)
              paginate(page: params[:page], per_page: (params[:per] || 25))
            end.results
          end

        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
georgia_mailer-0.1.2 lib/georgia/indexer/extensions/solr_adapter/georgia_mailer/message.rb
georgia_mailer-0.1.1 lib/georgia/indexer/extensions/solr_adapter/georgia_mailer/message.rb