Class: MultiSolr::SolrFilterBoolean

Inherits:
SolrFilterSimple show all
Defined in:
lib/multi_solr/solr_filter_boolean.rb

Overview

Filter for booleans

Instance Attribute Summary

Attributes inherited from SolrFilterSimple

#field_name, #name, #options

Instance Method Summary collapse

Methods inherited from SolrFilterSimple

#initialize, #label, #sanitize_value

Constructor Details

This class inherits a constructor from MultiSolr::SolrFilterSimple

Instance Method Details

#build_solr_query(value) ⇒ Object

Erzeugen des SolR-Query-Strings



8
9
10
11
# File 'lib/multi_solr/solr_filter_boolean.rb', line 8

def build_solr_query value
  return nil if value.blank?
  "#{@field_name}:#{to_bool(value)}"
end

#render_value(value, options = nil) ⇒ Object



14
15
16
# File 'lib/multi_solr/solr_filter_boolean.rb', line 14

def render_value value, options=nil
  to_bool(value) ? 'yes' : 'no'
end