Class: Mincer::Processors::PgSearch::SearchStatement
- Inherits:
-
Object
- Object
- Mincer::Processors::PgSearch::SearchStatement
- Defined in:
- lib/mincer/processors/pg_search/search_statement.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#options ⇒ Object
Returns the value of attribute options.
-
#pattern ⇒ Object
(also: #terms)
Returns the value of attribute pattern.
Instance Method Summary collapse
- #dictionary ⇒ Object
-
#initialize(columns, options = {}) ⇒ SearchStatement
constructor
A new instance of SearchStatement.
- #param_name ⇒ Object
- #sanitizers(type = :all) ⇒ Object
- #threshold ⇒ Object
Constructor Details
#initialize(columns, options = {}) ⇒ SearchStatement
Returns a new instance of SearchStatement.
8 9 10 |
# File 'lib/mincer/processors/pg_search/search_statement.rb', line 8 def initialize(columns, = {}) @columns, @options = columns, ::ActiveSupport::HashWithIndifferentAccess.new() end |
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
5 6 7 |
# File 'lib/mincer/processors/pg_search/search_statement.rb', line 5 def columns @columns end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/mincer/processors/pg_search/search_statement.rb', line 5 def @options end |
#pattern ⇒ Object Also known as: terms
Returns the value of attribute pattern.
5 6 7 |
# File 'lib/mincer/processors/pg_search/search_statement.rb', line 5 def pattern @pattern end |
Instance Method Details
#dictionary ⇒ Object
19 20 21 |
# File 'lib/mincer/processors/pg_search/search_statement.rb', line 19 def dictionary [:dictionary] || Mincer.config.pg_search.fulltext_engine[:dictionary] end |
#param_name ⇒ Object
27 28 29 |
# File 'lib/mincer/processors/pg_search/search_statement.rb', line 27 def param_name [:param_name] || Mincer.config.pg_search.param_name end |
#sanitizers(type = :all) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/mincer/processors/pg_search/search_statement.rb', line 12 def sanitizers(type = :all) @sanitizers ||= {} @sanitizers[type] ||= Sanitizer::AVAILABLE_SANITIZERS.select do |sanitizer| [sanitizer].is_a?(Hash) && [:query, :document].include?(type) ? [sanitizer][type] : [sanitizer] end end |