: I have a custom component which depends on the ordering of a : multi-valued parameter. Unfortunately it looks like the values do not : come back in the same order as they were put in the URL. Here is some : code to explain the behavior: ... : and I notice that the values are ordered differently than ["foo", "bar", : "baz"] that I would have expected. I am guessing its because the : SolrParams is a MultiMap structure, so order is destroyed on its way in.
a) MultiMapSolrParams does not destroy order on the way in b) when dealing with HTTP requests, the request params actaully use an instance of ServletSolrParams which is backed directly by the ServletRequest.getParameterMap() -- you should get the values returned in the exact order as ServletRequest.getParameterMap().get("myparam") : 1) is there a setting in Solr can use to enforce ordering of : multi-valued parameters? I suppose I could use a single parameter with : comma-separated values, but its a bit late to do that now... Should already be enforced in MultiMapSolrParams and ServletSolrParams : 2) is it possible to use a specific SolrParams object that preserves order? If so how? see above. : 3) is it possible to get a reference to the HTTP request object from within a component? If so how? not out of the box, because there is no garuntee that solr is even running in a servlet container. you can subclass SolrDispatchFilter to do this if you wish (note the comment in the execute() method). My questions to you... 1) what servlet container are you using? 2) have you tested your servlet container with a simple servlet (ie: eliminate solr from the equation) to verify that the ServletRequest.getParameterMap() contains your request values in order? if you debug this and find evidence that something in solr is re-ordering the values in a MultiMapSolrParams or ServletSolrParams *PLEASE* open a jira with a reproducable example .. that would definitley be an anoying bug we should get to the bottom of. -Hoss