QueryResponseWriter

QueryResponseWriter

A [WWW] QueryResponseWriter is a Solr Plugin that defines the response format for any request.

  1. QueryResponseWriter
    1. Configuration
    2. Response Writer Resolution
    3. List of Writers Available

Configuration

Multiple writers (including multiple instances of the same QueryResponseWriter class with different configurations) can be specified in the solrconfig.xml

    <queryResponseWriter name="foo" default="true" class="my.package.CustomResponseWriter"/>
    <queryResponseWriter name="bar" class="my.package.AnotherCustomResponseWriter"/>
    <queryResponseWriter name="blat" class="my.package.AnotherCustomResponseWriter">
      <int name="some_init_param">5</int>
    </queryResponseWriter> 

Response Writer Resolution

Clients access specific QueryResponseWriters using the 'wt' parameter For the above example, running on localhost:8983/solr/, you could access:

  http://localhost:8983/solr/select/?wt=foo&q=solr
  http://localhost:8983/solr/select/?wt=bar&q=solr
  http://localhost:8983/solr/select/?wt=blat&q=solr
  http://localhost:8983/solr/select/?q=solr

Solr selects a handler to process a request using the following steps...

  1. look for a writer with a name matching the "wt"

  2. look for a writer configured with default="true"

  3. look for a writer configured with name="standard"

  4. use an anonymous instance of XmlResponseWriter

List of Writers Available

The Javadocs contain [WWW] a complete list of Response Writers. Many of which have their own wiki pages...

last edited 2007-09-18 00:08:48 by HossMan