| org.apache.solr.request.QueryResponseWriter
All known Subclasses: org.apache.solr.request.JSONResponseWriter, org.apache.solr.request.RubyResponseWriter, org.apache.solr.request.XMLResponseWriter, org.apache.solr.request.PythonResponseWriter, org.apache.solr.request.XSLTResponseWriter,
QueryResponseWriter | public interface QueryResponseWriter (Code) | | Implementations of QueryResponseWriter are used to format responses to query requests.
Different QueryResponseWriter s are registered with the SolrCore .
One way to register a QueryResponseWriter with the core is thorugh the solrconfig.xml file.
Example solrconfig.xml entry to register a QueryResponseWRiter implementation to
handle all queries with a writer type of "simple":
<queryResponseWriter name="simple" class="foo.SimpleResponseWriter" />
A single instance of any registered QueryResponseWriter is created
via the default constructor and is reused for all relevant queries.
author: yonik version: $Id: QueryResponseWriter.java 472574 2006-11-08 18:25:52Z yonik $ |
CONTENT_TYPE_TEXT_ASCII | public static String CONTENT_TYPE_TEXT_ASCII(Code) | | |
CONTENT_TYPE_TEXT_UTF8 | public static String CONTENT_TYPE_TEXT_UTF8(Code) | | |
CONTENT_TYPE_XML_UTF8 | public static String CONTENT_TYPE_XML_UTF8(Code) | | |
getContentType | public String getContentType(SolrQueryRequest request, SolrQueryResponse response)(Code) | | Return the applicable Content Type for a request, this method
must be thread safe.
QueryResponseWriter's must implement this method to return a valid
HTTP Content-Type header for the request, that will logically
corrispond with the output produced by the write method.
a Content-Type string, which may not be null. |
init | public void init(NamedList args)(Code) | | init will be called just once, immediately after creation.
The args are user-level initialization parameters that
may be specified when declaring a response writer in
solrconfig.xml
|
write | public void write(Writer writer, SolrQueryRequest request, SolrQueryResponse response) throws IOException(Code) | | Write a SolrQueryResponse, this method must be thread save.
Information about the request (in particular: formating options) may be
obtained from req but the dominant source of information
should be rsp .
There are no mandatory actions that write must perform.
An empty write implementation would fulfill
all interface obligations.
|
|
|