From beb8b10556633972d9d123cc301e3f749f5864fb Mon Sep 17 00:00:00 2001 From: olcbean <26058559+olcbean@users.noreply.github.com> Date: Mon, 26 Feb 2018 16:08:37 +0100 Subject: [PATCH] Fix inconsistency in docs regarding single types (#28715) This commit fixes some inconsistencies in the docs regarding single types. The inconsistencies are between the verbiage and the relevant snippets. --- docs/reference/docs/delete-by-query.asciidoc | 5 ++--- docs/reference/docs/delete.asciidoc | 5 ++--- docs/reference/docs/get.asciidoc | 2 +- docs/reference/docs/reindex.asciidoc | 4 ++-- docs/reference/docs/update-by-query.asciidoc | 5 ++--- docs/reference/search/count.asciidoc | 2 +- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/docs/reference/docs/delete-by-query.asciidoc b/docs/reference/docs/delete-by-query.asciidoc index 7f92de53281..db2ff3eeb6e 100644 --- a/docs/reference/docs/delete-by-query.asciidoc +++ b/docs/reference/docs/delete-by-query.asciidoc @@ -71,8 +71,7 @@ these documents. In case a search or bulk request got rejected, `_delete_by_quer If you'd like to count version conflicts rather than cause them to abort then set `conflicts=proceed` on the url or `"conflicts": "proceed"` in the request body. -Back to the API format, you can limit `_delete_by_query` to a single type. This -will only delete `tweet` documents from the `twitter` index: +Back to the API format, this will delete tweets from the `twitter` index: [source,js] -------------------------------------------------- @@ -91,7 +90,7 @@ types at once, just like the search API: [source,js] -------------------------------------------------- -POST twitter,blog/tweet,post/_delete_by_query +POST twitter,blog/_docs,post/_delete_by_query { "query": { "match_all": {} diff --git a/docs/reference/docs/delete.asciidoc b/docs/reference/docs/delete.asciidoc index b8cf89a2410..782a625586b 100644 --- a/docs/reference/docs/delete.asciidoc +++ b/docs/reference/docs/delete.asciidoc @@ -3,8 +3,7 @@ The delete API allows to delete a typed JSON document from a specific index based on its id. The following example deletes the JSON document -from an index called twitter, under a type called tweet, with id valued -1: +from an index called `twitter`, under a type called `_doc`, with id `1`: [source,js] -------------------------------------------------- @@ -75,7 +74,7 @@ DELETE /twitter/_doc/1?routing=kimchy // CONSOLE // TEST[continued] -The above will delete a tweet with id 1, but will be routed based on the +The above will delete a tweet with id `1`, but will be routed based on the user. Note, issuing a delete without the correct routing, will cause the document to not be deleted. diff --git a/docs/reference/docs/get.asciidoc b/docs/reference/docs/get.asciidoc index 7bdac42f869..3cb1f6cde0c 100644 --- a/docs/reference/docs/get.asciidoc +++ b/docs/reference/docs/get.asciidoc @@ -261,7 +261,7 @@ GET twitter/_doc/2?routing=user1 // CONSOLE // TEST[continued] -The above will get a tweet with id 2, but will be routed based on the +The above will get a tweet with id `2`, but will be routed based on the user. Note, issuing a get without the correct routing, will cause the document not to be fetched. diff --git a/docs/reference/docs/reindex.asciidoc b/docs/reference/docs/reindex.asciidoc index 557706efa14..fe13c0c206e 100644 --- a/docs/reference/docs/reindex.asciidoc +++ b/docs/reference/docs/reindex.asciidoc @@ -160,9 +160,9 @@ POST _reindex // TEST[setup:twitter] `index` and `type` in `source` can both be lists, allowing you to copy from -lots of sources in one request. This will copy documents from the `tweet` and +lots of sources in one request. This will copy documents from the `_doc` and `post` types in the `twitter` and `blog` index. It'd include the `post` type in -the `twitter` index and the `tweet` type in the `blog` index. If you want to be +the `twitter` index and the `_doc` type in the `blog` index. If you want to be more specific you'll need to use the `query`. It also makes no effort to handle ID collisions. The target index will remain valid but it's not easy to predict which document will survive because the iteration order isn't well defined. diff --git a/docs/reference/docs/update-by-query.asciidoc b/docs/reference/docs/update-by-query.asciidoc index a8b12c6bd6b..527a007c5f1 100644 --- a/docs/reference/docs/update-by-query.asciidoc +++ b/docs/reference/docs/update-by-query.asciidoc @@ -63,8 +63,7 @@ conflicting document was updated between the start of the `_update_by_query` and the time when it attempted to update the document. This is fine because that update will have picked up the online mapping update. -Back to the API format, you can limit `_update_by_query` to a single type. This -will only update `tweet` documents from the `twitter` index: +Back to the API format, this will update tweets from the `twitter` index: [source,js] -------------------------------------------------- @@ -151,7 +150,7 @@ types at once, just like the search API: [source,js] -------------------------------------------------- -POST twitter,blog/tweet,post/_update_by_query +POST twitter,blog/_doc,post/_update_by_query -------------------------------------------------- // CONSOLE // TEST[s/^/PUT twitter\nPUT blog\n/] diff --git a/docs/reference/search/count.asciidoc b/docs/reference/search/count.asciidoc index 44340dfb9c0..f1c6cf7c573 100644 --- a/docs/reference/search/count.asciidoc +++ b/docs/reference/search/count.asciidoc @@ -30,7 +30,7 @@ NOTE: The query being sent in the body must be nested in a `query` key, same as the <> works Both examples above do the same thing, which is count the number of -tweets from the twitter index for a certain user. The result is: +tweets from the `twitter` index for a certain user. The result is: [source,js] --------------------------------------------------