Thinking about this some more... yes, the SolrRequest should say what
parser is used. It is the request that has to deal with the output in
the end.
Any change here need to make sure to address lines 125,126 of
CommonsHttpSolrServer
_invariantParams.set( CommonParams.WT, _processor.getWriterType() );
ryan
Grant Ingersoll wrote:
On Feb 8, 2008, at 4:39 PM, Yonik Seeley wrote:
On Feb 8, 2008 4:27 PM, Grant Ingersoll <[EMAIL PROTECTED]> wrote:
OK, I will look into it. setProcessor is only defined for the
CommonsHttpSolrServer and I am trying to use the abstract SolrServer,
but I guess I can cast. Also, the setProcessor isn't great in that it
isn't thread-safe (i.e. if I am reusing said SolrServer for other
tasks in other threads). Would adding an request() method that takes
in a ResponseParser make sense?
Or adding a response parser to SolrRequest perhaps?
Does a ResponseParser make sense for all SolrRequest objects?
Presumably, the reason setProcessor() isn't on SolrServer is b/c it
isn't needed for embedded, right?
I think that CommonsHttpSolrServer could be mod'ed to:
@Override
public NamedList<Object> request( final SolrRequest request ) throws
SolrServerException, IOException
{
return request(request, _processor);
}
public NamedList<Object> request(final SolrRequest request,
ResponseParser processor) throws SolrServerException, IOException{
...
I have a patch ready to go if people think it is worthwhile.
-Grant