From 1918a21baf4ce1c397fdf6792da9a9ce25c920f6 Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Mon, 9 Dec 2019 08:39:17 -0500 Subject: [PATCH] [DOCS] Correct inline shape snippets in shape query docs (#49921) In the shape query docs, the index mapping snippet uses the "geometry" shape field mapping. However, the doc index snippet uses the "location" property. This changes the "location" property to "geometry". It also adds a comment containing the search result snippet. This should prevent similar issues in the future. --- docs/reference/query-dsl/shape-query.asciidoc | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/docs/reference/query-dsl/shape-query.asciidoc b/docs/reference/query-dsl/shape-query.asciidoc index 6a1c7380976f2..7d212b1172ae1 100644 --- a/docs/reference/query-dsl/shape-query.asciidoc +++ b/docs/reference/query-dsl/shape-query.asciidoc @@ -37,10 +37,10 @@ PUT /example } } -POST /example/_doc?refresh +PUT /example/_doc/1?refresh=wait_for { "name": "Lucky Landing", - "location": { + "geometry": { "type": "point", "coordinates": [1355.400544, 5255.530286] } @@ -69,6 +69,48 @@ GET /example/_search } -------------------------------------------------- +//// +[source,console-result] +-------------------------------------------------- +{ + "took": 3, + "timed_out": false, + "_shards": { + "total": 1, + "successful": 1, + "skipped": 0, + "failed": 0 + }, + "hits": { + "total": { + "value": 1, + "relation": "eq" + }, + "max_score": 0.0, + "hits": [ + { + "_index": "example", + "_type": "_doc", + "_id": "1", + "_score": 0.0, + "_source": { + "name": "Lucky Landing", + "geometry": { + "type": "point", + "coordinates": [ + 1355.400544, + 5255.530286 + ] + } + } + } + ] + } +} +-------------------------------------------------- +// TESTRESPONSE[s/"took": 3/"took": $body.took/] +//// + ==== Pre-Indexed Shape The Query also supports using a shape which has already been indexed in