You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Benson Margulies <bi...@gmail.com> on 2012/04/02 14:58:50 UTC

A little mild abuse of SearchHandler

I've got a prototype of a RequestHandler that embeds, within itself, a
SearchHandler. Yes, I read the previous advice to be a query
component, but I found it a lot easier to chart my course.

I'm having some trouble with sorting. I came up with the following.
'args' is the usual Map<String, String[]>. firstpassSort is an array
of "score desc", "myfieldname asc". Sorting isn't happening. The
QParser does not seem to be seeing my sort spec, as if something is
trimming it out of the params. Is there something here I'm missing?

 args.put(CommonParams.SORT, firstpassSort);
 LocalSolrQueryRequest lsqr = new LocalSolrQueryRequest(req.getCore(),
      bqString, "standard", 0, rows, args);

  SolrQueryResponse localRes = new SolrQueryResponse();

  srh.handleRequest(lsqr, localRes); // ok, let the regular processor
do the job.

Re: A little mild abuse of SearchHandler

Posted by Benson Margulies <bi...@gmail.com>.
I've answered my own question, but it left me with a lot of curiosity.

Why is the convention to build strings joined with commas (e.g in
SolrQuery.addValueToParam) rather than to use the array option? All
these params are Map<String, String[]>, so why cram multiples into the
first slot with commas ?