org.apache.nutch.searcher.response
Interface ResponseWriter
- All Superinterfaces:
- Configurable, Pluggable
public interface ResponseWriter
- extends Pluggable, Configurable
Nutch extension point which allow writing search results in many different
output formats.
Method Summary |
void |
setContentType(String contentType)
Sets the returned content MIME type. |
void |
writeResponse(SearchResults results,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Writes out the search results response to the HttpServletResponse. |
X_POINT_ID
static final String X_POINT_ID
setContentType
void setContentType(String contentType)
- Sets the returned content MIME type. Populated though variables set in
the plugin.xml file of the ResponseWriter. This allows easily changing
output content types, for example for JSON from text/plain during tesing
and debugging to application/json in production.
- Parameters:
contentType
- The MIME content type to set.
writeResponse
void writeResponse(SearchResults results,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
- Writes out the search results response to the HttpServletResponse.
- Parameters:
results
- The SearchResults object containing hits and other info.request
- The HttpServletRequest object.response
- The HttpServletResponse object.
- Throws:
IOException
- If an error occurs while writing out the response.
Copyright © 2006 The Apache Software Foundation