You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2016/12/20 21:26:32 UTC
[Solr Wiki] Update of "ContentStream" by CassandraTargett
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The "ContentStream" page has been changed by CassandraTargett:
https://wiki.apache.org/solr/ContentStream?action=diff&rev1=8&rev2=9
Comment:
remove outdated content; point users to Ref Guide
+ {{{#!wiki important
+ This page exists for the Solr Community to share Tips, Tricks, and Advice about
+ [[https://cwiki.apache.org/confluence/display/solr/Content+Streams|Content Streams]].
+
+ Reference material previously located on this page has been migrated to the
+ [[https://cwiki.apache.org/solr/|Official Solr Reference Guide]].
+ If you need help, please consult the Reference Guide for the version of Solr you are using
+ for the specific details about using [[https://cwiki.apache.org/confluence/display/solr/Content+Streams|this feature]].
+
+ If you'd like to share information about how you use this feature, please see [[FrontPage#How_to_edit_this_Wiki|add it to this page]].
+ /* cwikimigrated */
- [[http://lucene.apache.org/solr/api/org/apache/solr/common/util/ContentStream.html|ContentStreams]] are an abstraction mechanism for accessing streaming data in [[SolrRequestHandler|SolrRequestHandlers]].
-
- <<TableOfContents(2)>>
-
- == Overview ==
-
- When !SolrRequestHandlers are accessed using path based URLs the [[http://lucene.apache.org/solr/api/org/apache/solr/request/SolrQueryRequest.html|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.)
-
- == Stream Sources ==
-
- Currently !RequestHandlers can get content streams a variety of ways:
- * For Multipart file upload, 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 contents of parameter "stream.body" is passed as a stream.
- * If remote streaming is enabled, the contents of each "stream.url" and "stream.file" parameters are fetched and passed as a stream
-
- If the contentType is "application/x-www-form-urlencoded" the full POST body is parsed as parameters and inlcuded in the [[http://svn.apache.org/repos/asf/lucene/dev/trunk/solr/src/java/org/apache/solr/request/SolrParams.java|SolrParams]].
-
- By default, curl sends a contentType="application/x-www-form-urlencoded" header. If you need to test a SolrRequestHandler content stream, you will need to set the content type with the "-H" flag. For example:
-
- {{{
- curl $URL -H 'Content-type:text/xml; charset=utf-8' --data-binary @$f
}}}
- == RemoteStreaming ==
-
- Remote streaming allows you to send the contents of a URL as a stream to a given !SolrRequestHandler. This could be used to send a remote or local file to an update plugin. If remote streaming is enabled, be aware that this allows anyone to send a request to any URL or local file and essentially allow anyone that can send a request directly to solr to view any file that solr can read.
-
- {{{
- <!--Make sure your system has authentication before enabling remote streaming!-->
- <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048" />
- }}}
-
- Example:
- {{{
- curl 'http://localhost:8983/solr/update/csv?stream.file=exampledocs/books.csv&stream.contentType=text/plain;charset=utf-8'
- }}}
-
-
- == Debugging ==
-
- The example solrconfig.xml includes a 'dump' handler
- {{{
- <requestHandler name="/debug/dump" class="solr.DumpRequestHandler" />
- }}}
-
- This handler simply outputs the contents of the !SolrQueryRequest using the specified writer type [[CoreQueryParameters |'wt']]. This is a useful tool to help understand what streams are available to to the !RequestHandlers.
-