Erik Hatcher schrieb:
On Nov 17, 2008, at 11:45 AM, Matthias Epheser wrote:
Just noticed that VelocityResponeWriter in trunk is very reduced to my
last
patch from 2008-07-25.
Right, that was intentional for my own simplicity's sake...
The crucial difference is the missing translation into a solrj
response by specifying the vl.response parameter. This was intended to
make template creation more handy, cause the queryResponse is much
nicer to navigate.
If this conversion is to specific and shouldn't be in
VelocityResponseWriter, would it be a problem to create a subclass
inside contrib/javascript?
I need to understand it a bit more, but no subclass is necessary...
we'll patch it into contrib/velocity's VrW like you had it before.
The key part is to pass a parameter like vl.response=QueryResponse, so the
transformation works like that:
object = request.getCore().getResourceLoader().newInstance(className,
"client.solrj.response.");
solrResponse.setResponse(new
EmbeddedSolrServer(request.getCore()).getParsedResponse(request, response));
This was done based on api changes from Ryan to generalize the second
setResponse part. In the etmplate , there is access to the created response, as
well as to the "rawResponse".
I'll try to add the least necessary stuff to current vrw, test ist against
solrjs and post a patch to jira.
matthias
Erik