On Dec 1, 2009, at 9:04 PM, Ross wrote:
I'm starting to play with Solr. This might be a silly question and not
particularly important but I'm curious.
I setup the example site using the tutorial. It works very well. I was
looking around the config files and notice that in my solrconfig.xml
that the queryResponseWriter area is commented out but they all still
work. wt=php etc returns the php format. How is it working if they're
not defined? Are they defined elsewhere?
Good question. Solr defines (in SolrCore) a default set of response
writers.
static{
HashMap<String, QueryResponseWriter> m= new HashMap<String,
QueryResponseWriter>();
m.put("xml", new XMLResponseWriter());
m.put("standard", m.get("xml"));
m.put("json", new JSONResponseWriter());
m.put("python", new PythonResponseWriter());
m.put("php", new PHPResponseWriter());
m.put("phps", new PHPSerializedResponseWriter());
m.put("ruby", new RubyResponseWriter());
m.put("raw", new RawResponseWriter());
m.put("javabin", new BinaryResponseWriter());
DEFAULT_RESPONSE_WRITERS = Collections.unmodifiableMap(m);
}
Note that these built in ones can be overridden, but not undefined, by
registering a response writer with the same name as a built in one.
Erik