lib/solrizer/extractor.rb in solrizer-3.0.0 vs lib/solrizer/extractor.rb in solrizer-3.1.0
- old
+ new
@@ -16,11 +16,14 @@
# @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)
- solr_doc[field_name] ||= []
- solr_doc[field_name] << formatted_value
+ if solr_doc[field_name]
+ solr_doc[field_name] = Array(solr_doc[field_name]) << formatted_value
+ else
+ solr_doc[field_name] = formatted_value
+ end
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