You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ct...@apache.org on 2018/02/01 21:26:02 UTC

lucene-solr:master: SOLR-11848: Ref Guide: include info on grouping operations and using curl for large files. This closes #303.

Repository: lucene-solr
Updated Branches:
  refs/heads/master 95122e144 -> a4320aab8


SOLR-11848: Ref Guide: include info on grouping operations and using curl for large files. This closes #303.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a4320aab
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a4320aab
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a4320aab

Branch: refs/heads/master
Commit: a4320aab8daac8994e78a28fdab4c4db6145d15a
Parents: 95122e1
Author: Cassandra Targett <ct...@apache.org>
Authored: Thu Feb 1 15:24:14 2018 -0600
Committer: Cassandra Targett <ct...@apache.org>
Committed: Thu Feb 1 15:24:14 2018 -0600

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  4 ++-
 .../src/uploading-data-with-index-handlers.adoc | 27 ++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a4320aab/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 60e4aba..c652c8b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -181,7 +181,7 @@ Bug Fixes
 
 * SOLR-11873: Use time based expiration cache in all necessary places in HdfsDirectoryFactory. (Mihaly Toth via Mark Miller)
 
-* SOLR-11661: New HDFS collection reuses unremoved data from a deleted HDFS collection with same name causes 
+* SOLR-11661: New HDFS collection reuses unremoved data from a deleted HDFS collection with same name causes
   inconsistent view of documents (Cao Manh Dat, shalin)
 
 Optimizations
@@ -245,6 +245,8 @@ Other Changes
 
 * SOLR-11067: REPLACENODE should identify appropriate nodes if targetNode is not provided (noble)
 
+* SOLR-11848: Update Ref Guide to include info on grouping operations and using curl for large files. (Dariusz Wojtas via Cassandra Targett)
+
 ==================  7.2.1 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a4320aab/solr/solr-ref-guide/src/uploading-data-with-index-handlers.adoc
----------------------------------------------------------------------
diff --git a/solr/solr-ref-guide/src/uploading-data-with-index-handlers.adoc b/solr/solr-ref-guide/src/uploading-data-with-index-handlers.adoc
index a240dcf..49f1f62 100644
--- a/solr/solr-ref-guide/src/uploading-data-with-index-handlers.adoc
+++ b/solr/solr-ref-guide/src/uploading-data-with-index-handlers.adoc
@@ -136,6 +136,26 @@ When using the Join query parser in a Delete By Query, you should use the `score
 
 The rollback command rolls back all add and deletes made to the index since the last commit. It neither calls any event listeners nor creates a new searcher. Its syntax is simple: `<rollback/>`.
 
+==== Grouping Operations
+
+You can post several commands in a single XML file by grouping them with the surrounding `<update>` element.
+
+[source,xml]
+----
+<update>
+  <add>
+    <doc><!-- doc 1 content --></doc>
+  </add>
+  <add>
+    <doc><!-- doc 2 content --></doc>
+  </add>
+  <delete>
+    <id>0002166313</id>
+  </delete>
+</update>
+----
+
+
 === Using curl to Perform Updates
 
 You can use the `curl` utility to perform any of the above commands, using its `--data-binary` option to append the XML message to the `curl` command, and generating a HTTP POST request. For example:
@@ -162,6 +182,13 @@ For posting XML messages contained in a file, you can use the alternative form:
 curl http://localhost:8983/solr/my_collection/update -H "Content-Type: text/xml" --data-binary @myfile.xml
 ----
 
+The approach above works well, but using the `--data-binary` option causes `curl` to load the whole `myfile.xml` into memory before posting it to server. This may be problematic when dealing with multi-gigabyte files. This alternative `curl` command performs equivalent operations but with minimal `curl` memory usage:
+
+[source,bash]
+----
+curl http://localhost:8983/solr/my_collection/update -H "Content-Type: text/xml" -T "myfile.xml" -X POST
+----
+
 Short requests can also be sent using a HTTP GET command, if enabled in <<requestdispatcher-in-solrconfig.adoc#requestparsers-element,RequestDispatcher in SolrConfig>> element, URL-encoding the request, as in the following. Note the escaping of "<" and ">":
 
 [source,bash]