Skip to content

Commit

Permalink
add DELETE options _mapping
Browse files Browse the repository at this point in the history
Several mappings can be deleted at once by defining several indices and types with

`[DELETE] /{index}/{type}`

`[DELETE] /{index}/{type}/_mapping`

`[DELETE] /{index}/_mapping/{type}`

where

`index= * | _all | glob pattern | name1, name2, …`

`type= * | _all | glob pattern | name1, name2, …`

Alternatively, the keyword `_mapings` can be used.

see roadmap issue elastic#4071
  • Loading branch information
brwe committed Jan 13, 2014
1 parent 024f19f commit 6dc928d
Show file tree
Hide file tree
Showing 15 changed files with 794 additions and 74 deletions.
21 changes: 19 additions & 2 deletions docs/reference/indices/delete-mapping.asciidoc
@@ -1,8 +1,25 @@
[[indices-delete-mapping]]
== Delete Mapping

Allow to delete a mapping (type) along with its data. The REST endpoint
is `/{index}/{type}` with `DELETE` method.
Allow to delete a mapping (type) along with its data. The REST endpoints are

[source,js]
--------------------------------------------------
[DELETE] /{index}/{type}
[DELETE] /{index}/{type}/_mapping
[DELETE] /{index}/_mapping/{type}
--------------------------------------------------

where

[horizontal]

`index`:: `* | _all | glob pattern | name1, name2, …`
`type`:: `* | _all | glob pattern | name1, name2, …`

Note, most times, it make more sense to reindex the data into a fresh
index compared to delete large chunks of it.
2 changes: 1 addition & 1 deletion rest-api-spec/api/indices.delete_mapping.json
Expand Up @@ -4,7 +4,7 @@
"methods": ["DELETE"],
"url": {
"path": "/{index}/{type}/_mapping",
"paths": ["/{index}/{type}/_mapping", "/{index}/{type}"],
"paths": ["/{index}/{type}/_mapping", "/{index}/{type}", "/{index}/_mapping/{type}", "/{index}/{type}/_mappings", "/{index}/_mappings/{type}"],
"parts": {
"index": {
"type" : "list",
Expand Down

0 comments on commit 6dc928d

Please sign in to comment.