From 27523b5e40921499212bd0c5f7f56c35cdebe073 Mon Sep 17 00:00:00 2001 From: Cassandra Targett Date: Mon, 2 Mar 2020 16:51:03 -0600 Subject: [PATCH] SOLR-14270: Move .gz example to CLI page; Remove bin/solr export from command-line-utilities.adoc --- .../src/command-line-utilities.adoc | 30 ------------------- .../src/solr-control-script-reference.adoc | 11 +++++-- 2 files changed, 9 insertions(+), 32 deletions(-) diff --git a/solr/solr-ref-guide/src/command-line-utilities.adoc b/solr/solr-ref-guide/src/command-line-utilities.adoc index 2e5c192f6d6..83be37205d4 100644 --- a/solr/solr-ref-guide/src/command-line-utilities.adoc +++ b/solr/solr-ref-guide/src/command-line-utilities.adoc @@ -154,33 +154,3 @@ Unlike the CLUSTERPROP command on the <.json`. If the file name ends with `.json.gz` , the output is a zip file of JSON. - -`-format`:: (Optional) Supported values are `json` or `javabin`. - -`-limit`:: (Optional) No:of docs to export. By default the entire collection is exported. - -`-fields`:: (Optional) Fields to be exported. By default, all fields are exported. - -Example 1: Export all documents in a collection `gettingstarted` into a file called `gettingstarted.json`: - -[source,bash] ----- -bin/solr export -url http://localhost:8983/solr/gettingstarted ----- - -Example 2: export 1M docs of collection `gettingstarted` into a file called `1MDocs.json.gz` as a zipped JSON file: - -[source,bash] ----- -bin/solr export -url http://localhost:8983/solr/gettingstarted -out 1MDocs.json.gz ----- diff --git a/solr/solr-ref-guide/src/solr-control-script-reference.adoc b/solr/solr-ref-guide/src/solr-control-script-reference.adoc index cfa68d8becc..9349fe5081a 100644 --- a/solr/solr-ref-guide/src/solr-control-script-reference.adoc +++ b/solr/solr-ref-guide/src/solr-control-script-reference.adoc @@ -896,7 +896,7 @@ The `bin/solr export` command takes the following parameters: The file format of the export, `jsonl` (default) or `javabin`. Choosing `javabin` exports to a file with extension `.javabin` which is the native Solr format. This is compact and faster to import. `out`:: -The file name of the export. +The file name of the export. If the file name ends with `json.gz` the output will be compressed into a .gz file. `query`:: A custom query. The default is `\*:*` which will export all documents. @@ -907,13 +907,20 @@ A comma separated list of fields to be exported. `limit`:: The number of documents to export. The default is `100`. The value `-1` will export all documents. -*Example* +*Examples* Export all documents from a collection `gettingstarted`: [source,bash] bin/solr export -url http://localhost:8983/solr/gettingstarted limit -1 +Export all documents of collection `gettingstarted` into a file called `1MDocs.json.gz` as a zipped JSON file: + +[source,bash] +---- +bin/solr export -url http://localhost:8983/solr/gettingstarted -1 -out 1MDocs.json.gz +---- + === Importing Documents to a Collection Once you have exported documents in a file, you can use the <> to import them to a new Solr collection.