Skip to content

Commit

Permalink
[Update] delete index guide with ignore_unavailable (#665)
Browse files Browse the repository at this point in the history
* update: delete index with ignore_unavailable

Signed-off-by: tejeshreddy <[email protected]>

* fix: removed typos

Signed-off-by: tejeshreddy <[email protected]>

* update: changelog.md

Signed-off-by: tejeshreddy <[email protected]>

* update: changelog with PR link

Signed-off-by: tejeshreddy <[email protected]>

---------

Signed-off-by: tejeshreddy <[email protected]>
  • Loading branch information
tejeshreddy authored Dec 11, 2023
1 parent 9ba7747 commit 9fbbc54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Added
- Updated `guides/index_lifecycle.md` to provide example of `ignore_unavailable: true` while deleting indices. ([665](https://github.com/opensearch-project/opensearch-js/pull/665))
### Dependencies
- Bumps `@types/node` from 20.9.0 to 20.10.4
- Bumps `eslint` from 8.54.0 to 8.55.0
Expand Down
4 changes: 2 additions & 2 deletions guides/index_lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ client.indices.delete({index: 'movies'})
We can also delete multiple indices at once:

```javascript
client.indices.delete({index: ['movies', 'paintings', 'burner'], ignore: 404})
client.indices.delete({index: ['movies', 'paintings', 'burner'], ignore_unavailable: true,})
```
Notice that we are passing `ignore: 404` to the request. This tells the client to ignore the `404` error if the index doesn't exist for deletion. Without it, the above `delete` request will throw an error because the `movies` index has already been deleted in the previous example.
Notice that we are passing `ignore_unavailable: true` to the request. This tells the client to ignore throwing error and deleting the index if it doesn't exist. Without it, the above `delete` request will throw an error because the `movies` index has already been deleted in the previous example.

## Cleanup

Expand Down

0 comments on commit 9fbbc54

Please sign in to comment.