lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Method toMultiMap(NamedList params) in SolrParams
Date Mon, 02 Feb 2009 23:46:05 GMT

: I'm getting confused about the method Map<String,String[]>
: toMultiMap(NamedList params) in SolrParams class.

toMultiMap probably shouldn't have ever been made public -- it' really 
only ment to be use by toSolrParams (it's refactored out to make the code 
easier to read)

: When some of your parameter is instanceof String[] it's converted to to
: String using the toString() method, which seems
: to me to be wrong. It is probably assuming, that the values in NamedList are
: all String, but when you look at the method

It's not assuming that the NamedList only contains Strings -- it's 
assuming that since it needs to produce a String[] then every object in 
the NamedList should be toString()ed to get a String.  in your case since 
the object is already String[] that seems silly -- but you have to keep in 
mind the whole point is to build a String[] out of *multiple* objects 
(that have the same key in the NamedList) ... so if your NamedLIst 
contained two String[]'s with the same key, what would you expect it to do 
if the behavior was different (union the two arrays?)


View raw message