Sha256: 5f5baf5230cc8e6df0b599805baf22c8484304df1fd2341af0d1c0333622b6f1

Contents?: true

Size: 420 Bytes

Versions: 12

Compression:

Stored size: 420 Bytes

Contents

# Filter for booleans

class MultiSolr::SolrFilterBoolean < MultiSolr::SolrFilterSimple



  # Erzeugen des SolR-Query-Strings
  def build_solr_query value
    return nil if value.blank?
    "#{@field_name}:#{to_bool(value)}"
  end


  def render_value value
    to_bool(value) ? 'yes' : 'no'
  end


  private


  def to_bool value
    value && (value == true || value=='1' || value==1 || value=='true')
  end

end




Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
multi-solr-01.09.00 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.08.01 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.08.00 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.07.07 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.07.06 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.07.05 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.07.04 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.07.03 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.07.02 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.07.01 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.07.00 lib/multi_solr/solr_filter_boolean.rb
multi-solr-01.06.00 lib/multi_solr/solr_filter_boolean.rb