title: Converting the solr response (solrdocumentlist) to json (or xml)
body: <p>I am working on a search in which I am trying to convert the response from a <code>HttpSolrServer</code> to json format.  The response comes as a <code>SolrDocumentList</code>.  The code I have right now is:</p>
  
  <pre><code>SolrQuery solrQuery = new SolrQuery(query);
  solrQuery.setParam("wt", "json");  //doesn't affect the return format
  
  QueryResponse rsp = solrServer.query(solrQuery);
  SolrDocumentList docs = rsp.getResults();
  
  return docs.toString();
  </code></pre>
  
  <p>When I print out the return, it comes back as:</p>
  
  <pre><code>{numFound=2,start=0,docs=[SolrDocument{cat=[electronics, camera], features=[3x zoop, 7.1 megapixel Digital ELPH, movie clips up to 640x480 @30 fps, 2.0" TFT LCD, 118,000 pixels, built in flash, red-eye reduction], id=9885A004, inStock=true, includes=32MB SD card, USB cable, AV cable, battery, manu=Canon Inc., manufacturedate_dt=Mon Feb 13 10:26:37 EST 2006, name=Canon PowerShot SD500, popularity=7, price=329.95, store=45.17614,-93.87341, weight=6.4}, SolrDocument{cat=[electronics, multifunction printer, printer, scanner, copier], features=[Multifunction ink-jet color photo printer, Flatbed scanner, optical scan resolution of 1,200 x 2,400 dpi, 2.5" color LCD preview screen, Duplex Copying, Printing speed up to 29ppm black, 19ppm color, Hi-Speed USB, memory card: CompactFlash, Micro Drive, SmartMedia, Memory Stick, Memory Stick Pro, SD Card, and MultiMediaCard], id=0579B002, inStock=true, manu=Canon Inc., name=Canon PIXMA MP500 All-In-One Photo Printer, popularity=6, price=179.99, store=45.17614,-93.87341, weight=352.0}]}}
  </code></pre>
  
  <p>for a search on <code>canon</code> using their example data.</p>
  
  <p>If I instead do <code>return rsp.toString();</code> I get back the header information with it as:</p>
  
  <pre><code>{responseHeader={status=0,QTime=1,params={indent=true,q=canon\*,wt=xml,version=2.2}},response={numFound=2,start=0,docs=[SolrDocument{cat=[electronics, camera], features=[3x zoop, 7.1 megapixel Digital ELPH, movie clips up to 640x480 @30 fps, 2.0" TFT LCD, 118,000 pixels, built in flash, red-eye reduction], id=9885A004, inStock=true, includes=32MB SD card, USB cable, AV cable, battery, manu=Canon Inc., manufacturedate_dt=Mon Feb 13 10:26:37 EST 2006, name=Canon PowerShot SD500, popularity=7, price=329.95, store=45.17614,-93.87341, weight=6.4}, SolrDocument{cat=[electronics, multifunction printer, printer, scanner, copier], features=[Multifunction ink-jet color photo printer, Flatbed scanner, optical scan resolution of 1,200 x 2,400 dpi, 2.5" color LCD preview screen, Duplex Copying, Printing speed up to 29ppm black, 19ppm color, Hi-Speed USB, memory card: CompactFlash, Micro Drive, SmartMedia, Memory Stick, Memory Stick Pro, SD Card, and MultiMediaCard], id=0579B002, inStock=true, manu=Canon Inc., name=Canon PIXMA MP500 All-In-One Photo Printer, popularity=6, price=179.99, store=45.17614,-93.87341, weight=352.0}]}}
  </code></pre>
  
  <p>I know that with <code>HttpSolrServer</code> the response format can only currently be of xml or javabin (which I have set to xml).  This seems to have no impact on the actual returned results and their format.  </p>
  
  <p>I cannot seem to find anything about converting the response to a json.  Any ideas?</p>