samvera-deprecated / solrizer

A lightweight, configurable tool for indexing metadata into solr.
Apache License 2.0
30 stars 13 forks source link

Index type :boolean does not handle FalseClass #25

Closed acurley closed 10 years ago

acurley commented 10 years ago

Although Sorlizer::FieldMapper#extract_type assigns the type to boolean when the value is the Ruby FalseClass, Solrizer.insert_field does not add that boolean to the document.

doc = Hash.new
Solrizer.insert_field(doc, 'foo', false)
doc == {}

I believe the behavior ought to be:

doc = Hash.new
Solrizer.insert_field(doc, 'foo', false)
doc == {'foo_bsi' => false}

Currently the specs only cover if the boolean is TrueClass.

I will submit a pull request shortly.

awead commented 10 years ago

I think this might be because we don't have a default descriptor for boolean. See Solrizer::DefaultDescriptors