Content streams are bulk data passed with a request to Solr.
When Solr RequestHandlers are accessed using path based URLs, the
SolrQueryRequest object containing the parameters of the request may also contain a list of ContentStreams containing bulk data for the request.
(The name SolrQueryRequest is a bit misleading: it is involved in all requests, regardless of whether it is a query request or an update request.)
Currently request handlers can get content streams in a variety of ways:
For multipart file uploads, each file is passed as a stream.
For POST requests where the content-type is not
application/x-www-form-urlencoded, the raw POST body is passed as a stream. The full POST body is parsed as parameters and included in the Solr parameters.
The contents of parameter
stream.bodyis passed as a stream. Requires
stream.fileparameters is resolved / fetched and passed as a stream. Requires
By default, curl sends a
If you need to test a SolrContentHeader content stream, you will need to set the content type with curl’s
Remote streaming lets you send the contents of a URL as a stream to a given Solr RequestHandler. You could use remote streaming to send a remote or local file to an update plugin.
Remote streaming is disabled by default. Enabling it is not recommended in a production situation without additional security between you and untrusted remote clients.
If remote streaming is used, be aware that this allows anyone to send a request to any URL or local file. And with the DumpRequestHandler anyone can view what Solr has access to.
Enable it with this environment variable:
The source of the data can be compressed using gzip, and Solr will generally detect this.
The detection is based on either the presence of a
Content-Encoding: gzip HTTP header or the file ending with .gz or .gzip.
Gzip doesn’t apply to
The implicit "dump" RequestHandler (see Implicit Request Handlers) simply outputs the contents of the Solr QueryRequest using the specified writer type
This is a useful tool to help understand what streams are available to the RequestHandlers.