You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Ross <te...@gmail.com> on 2009/12/02 03:04:49 UTC

Response writer configs

Hi all

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?

Thanks
Ross

Re: Response writer configs

Posted by Chris Hostetter <ho...@fucit.org>.
: I guess we should remove this commented response writers from the
: example solrconfig. It adds no value.

The comment tried to make it clear that it was showing what writers were 
enabled by default.  But i changed it to be more in line with what we 
have for search components.





-Hoss


Re: Response writer configs

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
I guess we should remove this commented response writers from the
example solrconfig. It adds no value.

On Wed, Dec 2, 2009 at 9:38 AM, Erik Hatcher <er...@gmail.com> wrote:
>
> 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
>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re: Response writer configs

Posted by Erik Hatcher <er...@gmail.com>.
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