lib/solrizer/extractor.rb in solrizer-2.0.0.rc2 vs lib/solrizer/extractor.rb in solrizer-2.0.0.rc3
- old
+ new
@@ -19,14 +19,11 @@
# @param [Hash] solr_doc
# @param [String] field_name
# @param [String] field_value
def self.insert_solr_field_value(solr_doc, field_name, field_value)
formatted_value = self.format_node_value(field_value)
- if solr_doc.has_key?(field_name)
- solr_doc[field_name] << formatted_value
- else
- solr_doc.merge!( {field_name => [formatted_value]} )
- end
+ solr_doc[field_name] ||= []
+ solr_doc[field_name] << formatted_value
return solr_doc
end
# Strips the majority of whitespace from the values array and then joins them with a single blank delimitter
# Returns an empty string if values argument is nil