class Mincer::Processors::PgSearch::SearchStatement

Attributes

columns[RW]
options[RW]
pattern[RW]
terms[RW]

Public Class Methods

new(columns, options = {}) click to toggle source
# File lib/mincer/processors/pg_search/search_statement.rb, line 8
def initialize(columns, options = {})
  @columns, @options = columns, ::ActiveSupport::HashWithIndifferentAccess.new(options)
end

Public Instance Methods

dictionary() click to toggle source
# File lib/mincer/processors/pg_search/search_statement.rb, line 19
def dictionary
  options[:dictionary] || Mincer.config.pg_search.fulltext_engine[:dictionary]
end
param_name() click to toggle source
# File lib/mincer/processors/pg_search/search_statement.rb, line 27
def param_name
  options[:param_name] || Mincer.config.pg_search.param_name
end
sanitizers(type = :all) click to toggle source
# File lib/mincer/processors/pg_search/search_statement.rb, line 12
def sanitizers(type = :all)
  @sanitizers ||= {}
  @sanitizers[type] ||= Sanitizer::AVAILABLE_SANITIZERS.select do |sanitizer|
    options[sanitizer].is_a?(Hash) && [:query, :document].include?(type) ? options[sanitizer][type] : options[sanitizer]
  end
end
threshold() click to toggle source
# File lib/mincer/processors/pg_search/search_statement.rb, line 23
def threshold
  options[:threshold] || Mincer.config.pg_search.trigram_engine[:threshold]
end