Skip to content

Commit

Permalink
[DOCS] Correct inline shape snippets in shape query docs (#49921)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrodewig committed Dec 9, 2019
1 parent 0965a10 commit 1918a21
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions docs/reference/query-dsl/shape-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1918a21

Please sign in to comment.