@@ -21,7 +21,7 @@ Install [pre-commit](https://pre-commit.com/#install).
2121Prior to commit, run:
2222
2323``` shell
24- pre-commit run --all-files`
24+ pre-commit run --all-files
2525```
2626
2727
@@ -81,7 +81,7 @@ Create a snapshot repository. This puts the files in the `elasticsearch/snapshot
8181the elasticsearch.yml and docker-compose files create a mapping from that directory to
8282` /usr/share/elasticsearch/snapshots ` within the Elasticsearch container and grant permissions on using it.
8383
84- ```
84+ ``` shell
8585curl -X " PUT" " http://localhost:9200/_snapshot/my_fs_backup" \
8686 -H ' Content-Type: application/json; charset=utf-8' \
8787 -d $' {
@@ -97,7 +97,7 @@ a snapshot named `my_snapshot_2` and waits for the action to be completed before
9797asynchronously, and queried for status. The ` indices ` parameter determines which indices are snapshotted, and
9898can include wildcards.
9999
100- ```
100+ ``` shell
101101curl -X " PUT" " http://localhost:9200/_snapshot/my_fs_backup/my_snapshot_2?wait_for_completion=true" \
102102 -H ' Content-Type: application/json; charset=utf-8' \
103103 -d $' {
@@ -113,20 +113,20 @@ curl -X "PUT" "http://localhost:9200/_snapshot/my_fs_backup/my_snapshot_2?wait_f
113113
114114To see the status of this snapshot:
115115
116- ```
116+ ``` shell
117117curl http://localhost:9200/_snapshot/my_fs_backup/my_snapshot_2
118118```
119119
120120To see all the snapshots:
121121
122- ```
122+ ``` shell
123123curl http://localhost:9200/_snapshot/my_fs_backup/_all
124124```
125125
126126To restore a snapshot, run something similar to the following. This specific command will restore any indices that
127127match ` items_* ` and rename them so that the new index name will be suffixed with ` -copy ` .
128128
129- ```
129+ ``` shell
130130curl -X " POST" " http://localhost:9200/_snapshot/my_fs_backup/my_snapshot_2/_restore?wait_for_completion=true" \
131131 -H ' Content-Type: application/json; charset=utf-8' \
132132 -d $' {
@@ -137,15 +137,14 @@ curl -X "POST" "http://localhost:9200/_snapshot/my_fs_backup/my_snapshot_2/_rest
137137 "indices": "items_*",
138138 "rename_pattern": "items_(.+)"
139139}'
140-
141140```
142141
143142Now the item documents have been restored in to the new index (e.g., ` my-collection-copy ` ), but the value of the
144143` collection ` field in those documents is still the original value of ` my-collection ` . To update these to match the
145144new collection name, run the following Elasticsearch Update By Query command, substituting the old collection name
146145into the term filter and the new collection name into the script parameter:
147146
148- ```
147+ ``` shell
149148curl -X " POST" " http://localhost:9200/items_my-collection-copy/_update_by_query" \
150149 -H ' Content-Type: application/json; charset=utf-8' \
151150 -d $' {
@@ -164,7 +163,7 @@ curl -X "POST" "http://localhost:9200/items_my-collection-copy/_update_by_query"
164163
165164Then, create a new collection through the api with the new name for each of the restored indices:
166165
167- ```
166+ ``` shell
168167curl -X " POST" " http://localhost:8080/collections" \
169168 -H ' Content-Type: application/json' \
170169 -d $' {
0 commit comments