: So as you mentioned in your last mail, how can I prepare a combined
: response for this xml doc and even if I do I don't think it would work
: because the same I am doing in the RequstHandler.

Part of the disconnect you seem to be having with the advice others have 
been giving you is that Solr does a very good job of abstracting away the 
*data* being returned to users from the *format* of that data, similar to 
an MVC setup (Ryan McKinley once told me he used Solr as his MVC Framework 
for all sorts of applications even if they didn't use the underlying 
index).

RequestHandlers are responsible for processing hte logic of a request (the 
Controller) and creating/manipulating the SolrQueryresponse (Model) which 
is then formated and written back to clients using a ResponseWriter (View) 
... clients can request to use a completley arbitrary ResponseWriter 
depending on what format they want to get data in, independent of the 
RequestHandler they use to generate the data.

In your case, the data that your custom RequestHandler wants to return is 
itself an XML structure -- but that doens't mean the existing solr XML 
ResponseWriter is prepared otwrite it out to you as is -- the XML 
ResponseWriter is designed to serialized structures of the supported data 
types in a specific solr XML format -- just as the JSON ResponseWriter is 
designed to serialize structures of the supported data types in a specific
solr json format, etc...

you could serialize your XML DOM as a string, and ask the response writer 
to handle that -- but it's probably not going to be what you want, because 
he response writer itself is going to take your arbitrary string data 
(that just so happens to be XML) and wrap it in it's own markup (XML, 
JSON, etc...)

In gneral, i agree with the questions/comments made by several other 
people...

1) what *exactly* is your ultimate goal (XY Problem?)
2) why are you doing this XML combining logic in solr, and not in your own 
application

But if you insist on the approach you are taking, you may find that the 
RawResponseWriter is useful to you -- it is an extremely specialized  
ResponseWriter for the purposes of use in the solr Admin request handlers 
and for remotely streaming files in DIH, but it may also work for your 
purposes.


-Hoss

Reply via email to