Skip to content

Commit

Permalink
Updating docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysrevans3 committed Jan 29, 2025
1 parent 1ea1741 commit 8150b47
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,17 +267,17 @@ A reindex operation might be useful to apply changes to documents or to correct

The index templates will make sure that manually created indices will also have the correct mappings and settings.

In this example, we will make a copy of an existing Item index `items_my-collection-000001` but change the Item identifier to be lowercase.
In this example, we will make a copy of an existing Item index `items_my-collection-lower_my-collection-hex-000001` but change the Item identifier to be lowercase.

```shell
curl -X "POST" "http://localhost:9200/_reindex" \
-H 'Content-Type: application/json' \
-d $'{
"source": {
"index": "items_my-collection-000001"
"index": "items_my-collection-lower_my-collection-hex-000001"
},
"dest": {
"index": "items_my-collection-000002"
"index": "items_my-collection-lower_my-collection-hex-000002"
},
"script": {
"source": "ctx._source.id = ctx._source.id.toLowerCase()",
Expand All @@ -286,7 +286,7 @@ curl -X "POST" "http://localhost:9200/_reindex" \
}'
```

If we are happy with the data in the newly created index, we can move the alias `items_my-collection` to the new index `items_my-collection-000002`.
If we are happy with the data in the newly created index, we can move the alias `items_my-collection` to the new index `items_my-collection-lower_my-collection-hex-000002`.
```shell
curl -X "POST" "http://localhost:9200/_aliases" \
-h 'Content-Type: application/json' \
Expand All @@ -300,7 +300,7 @@ curl -X "POST" "http://localhost:9200/_aliases" \
},
{
"add": {
"index": "items_my-collection-000002",
"index": "items_my-collection-lower_my-collection-hex-000002",
"alias": "items_my-collection"
}
}
Expand Down

0 comments on commit 8150b47

Please sign in to comment.