lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: facet response
Date Mon, 22 Jan 2007 22:48:38 GMT

: > Ugh ... please no ... the "List" in "NamedList" is what indicates that
: > order is a factor (it's what distinguishes a NamedList from a hypothetical
: > MultiValueMap")
: But we also use it when order doesn't totally matter, but it's still nice.

I agree ... a NamedList is nice when you want to refrence things by names,
or when you want to allow the same name to refer to multiple things, or
when you want to have some things that are named and some that are left
unnamed ... but in all of those cases order matters.

if you are using a NamedList to store data where everything has a name,
and that name refers to only one thing (it might be a list, but the
important thing is you add the list as a single value) and you dont'
really care about the order when you are all done, you should use a Map.

: Should the top level (containing responseHeader, result, facets, etc)
: be ordered or unordered?  We currently order pretty much everything,
: even when it's slightly redundant (we highlight docs in order, but we
: also include a unique id).
: Even when order doesn't strictly matter, it's still nice to see things
: ordered in the response (the responseHeader first for instance).

right ... but as you pointed out to me way back in the day...

  > Yeah,  JSON should strike a different balance.  If we tried to make
  > JSON convey 100% if the info that the XML does, it wouldn't be worth
  > it IMO.  It would be horrendously ugly.'s inheriently a "lossy" representation of the information.

: So what's your proposal for what a facet list should look like in JSON?

i don't have a specific one regarding facets ... i think that in general,
writers should present NamedLists in a way that makes them easy to parse
by the client as an ordered list of pairs; while Maps can be displayed in
any way that makes them easy to parse by the client as a map of key=>val.

According to the docs, seems like it would ensure that
there is no data loss for NamedLists correct? ... if the output still
seems too verbose in that case because the core RequestHandlers use
NamedLists even when order doesn't matter, then lets change the
RequestHandlers so it uses Maps in those cases.


View raw message