def solr_names_and_values(field_name, field_value, index_types)
      return {} if field_value.nil?
      
      # Determine the set of index types
      index_types = Array(index_types)
      index_types.uniq!
      index_types.dup.each do |index_type|
        if index_type.to_s =~ /^not_(.*)/
          index_types.delete index_type # not_foo
          index_types.delete $1.to_sym  # foo
        end
      end
      
      # Map names and values
      
      results = {}

      # Time seems to extend enumerable, so wrap it so we don't interate over each of its elements.
      field_value = [field_value] if field_value.kind_of? Time
      
      index_types.each do |index_type|
        Array(field_value).each do |single_value|
          # Get mapping for field
          descriptor = indexer(index_type)
          data_type = extract_type(single_value)
          name, converter = descriptor.name_and_converter(field_name, type: data_type)
          next unless name

          # Is there a custom converter?
          # TODO instead of a custom converter, look for input data type and output data type. Create a few methods that can do that cast.

          value = if converter
            if converter.arity == 1
              converter.call(single_value)
            else
              converter.call(single_value, field_name)
            end
          elsif data_type == :boolean
            single_value
          else
            single_value.to_s
          end
          
          # Add mapped name & value, unless it's a duplicate
          if descriptor.evaluate_suffix(data_type).multivalued?
            values = (results[name] ||= [])
            values << value unless value.nil? || values.include?(value)
          else
            Solrizer.logger.warn "Setting #{name} to `#{value}', but it already had `#{results[name]}'" if results[name] && Solrizer.logger
            results[name] = value
          end
        end
      end
        
      results
    end
def solr_names_and_values(field_name, field_value, index_types)
      return {} if field_value.nil?
      
      # Determine the set of index types
      index_types = Array(index_types)
      index_types.uniq!
      index_types.dup.each do |index_type|
        if index_type.to_s =~ /^not_(.*)/
          index_types.delete index_type # not_foo
          index_types.delete $1.to_sym  # foo
        end
      end
      
      # Map names and values
      
      results = {}

      # Time seems to extend enumerable, so wrap it so we don't interate over each of its elements.
      field_value = [field_value] if field_value.kind_of? Time
      
      index_types.each do |index_type|
        Array(field_value).each do |single_value|
          # Get mapping for field
          descriptor = indexer(index_type)
          data_type = extract_type(single_value)
          name, converter = descriptor.name_and_converter(field_name, type: data_type)
          next unless name

          # Is there a custom converter?
          # TODO instead of a custom converter, look for input data type and output data type. Create a few methods that can do that cast.

          value = if converter
            if converter.arity == 1
              converter.call(single_value)
            else
              converter.call(single_value, field_name)
            end
          elsif data_type == :boolean
            single_value
          else
            single_value.to_s
          end
          
          # Add mapped name & value, unless it's a duplicate
          if descriptor.evaluate_suffix(data_type).multivalued?
            values = (results[name] ||= [])
            values << value unless value.nil? || values.include?(value)
          else
            Solrizer.logger.warn "Setting #{name} to `#{value}', but it already had `#{results[name]}'" if results[name] && Solrizer.logger
            results[name] = value
          end
        end
      end
        
      results
    end
Given a field name-value pair, a data type, and an array of index types, returns a hash of
 mapped names and values. The values in the hash are _arrays_, and may contain multiple values.