Skip to content

Commit aa6a256

Browse files
committed
add descriptions
1 parent 53c88e3 commit aa6a256

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

README.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,14 @@ You can customize additional settings in your `.env` file:
324324
curl -X "PUT" "http://localhost:9200/_snapshot/my_fs_backup" \
325325
-H 'Content-Type: application/json; charset=utf-8' \
326326
-d $'{
327-
"type": "fs",
328-
"settings": {
329-
"location": "/usr/share/elasticsearch/snapshots/my_fs_backup"
330-
}
327+
"type": "fs",
328+
"settings": {
329+
"location": "/usr/share/elasticsearch/snapshots/my_fs_backup"
330+
}
331331
}'
332332
```
333+
- This creates a snapshot repository that stores files in the elasticsearch/snapshots directory in this git repo clone
334+
- The elasticsearch.yml and compose files create a mapping from that directory to /usr/share/elasticsearch/snapshots within the Elasticsearch container and grant permissions for using it
333335

334336
- **Creating a Snapshot**:
335337
```shell
@@ -345,6 +347,9 @@ You can customize additional settings in your `.env` file:
345347
"indices": "items_my-collection"
346348
}'
347349
```
350+
- This creates a snapshot named my_snapshot_2 and waits for the action to be completed before returning
351+
- This can also be done asynchronously by omitting the wait_for_completion parameter, and queried for status later
352+
- The indices parameter determines which indices are snapshotted, and can include wildcards
348353

349354
- **Viewing Snapshots**:
350355
```shell
@@ -354,6 +359,7 @@ You can customize additional settings in your `.env` file:
354359
# View all snapshots
355360
curl http://localhost:9200/_snapshot/my_fs_backup/_all
356361
```
362+
- These commands allow you to check the status and details of your snapshots
357363

358364
- **Restoring a Snapshot**:
359365
```shell
@@ -368,6 +374,8 @@ You can customize additional settings in your `.env` file:
368374
"rename_pattern": "items_(.+)"
369375
}'
370376
```
377+
- This specific command will restore any indices that match items_* and rename them so that the new index name will be suffixed with -copy
378+
- The rename_pattern and rename_replacement parameters allow you to restore indices under new names
371379

372380
- **Updating Collection References**:
373381
```shell
@@ -386,6 +394,8 @@ You can customize additional settings in your `.env` file:
386394
}
387395
}'
388396
```
397+
- After restoring, the item documents have been restored in the new index (e.g., my-collection-copy), but the value of the collection field in those documents is still the original value of my-collection
398+
- This command updates these values to match the new collection name using Elasticsearch's Update By Query feature
389399
390400
- **Creating a New Collection**:
391401
```shell
@@ -395,6 +405,8 @@ You can customize additional settings in your `.env` file:
395405
"id": "my-collection-copy"
396406
}'
397407
```
408+
- The final step is to create a new collection through the API with the new name for each of the restored indices
409+
- This gives you a copy of the collection that has a resource URI (/collections/my-collection-copy) and can be correctly queried by collection name
398410
399411
### Reindexing
400412
@@ -404,6 +416,7 @@ You can customize additional settings in your `.env` file:
404416
- Apply changes to documents
405417
- Correct dynamically generated mappings
406418
- Transform data (e.g., lowercase identifiers)
419+
- The index templates will make sure that manually created indices will also have the correct mappings and settings
407420
408421
- **Example: Reindexing with Transformation**:
409422
```shell
@@ -422,6 +435,8 @@ You can customize additional settings in your `.env` file:
422435
}
423436
}'
424437
```
438+
- In this example, we make a copy of an existing Item index but change the Item identifier to be lowercase
439+
- The script parameter allows you to transform documents during the reindexing process
425440
426441
- **Updating Aliases**:
427442
```shell
@@ -444,6 +459,9 @@ You can customize additional settings in your `.env` file:
444459
]
445460
}'
446461
```
462+
- If you are happy with the data in the newly created index, you can move the alias items_my-collection to the new index
463+
- This makes the modified Items with lowercase identifiers visible to users accessing my-collection in the STAC API
464+
- Using aliases allows you to switch between different index versions without changing the API endpoint
447465
448466
## Auth
449467

0 commit comments

Comments
 (0)