Skip to content

Commit 1918a21

Browse files
committed
[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.
1 parent 0965a10 commit 1918a21

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

docs/reference/query-dsl/shape-query.asciidoc

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ PUT /example
3737
}
3838
}
3939
40-
POST /example/_doc?refresh
40+
PUT /example/_doc/1?refresh=wait_for
4141
{
4242
"name": "Lucky Landing",
43-
"location": {
43+
"geometry": {
4444
"type": "point",
4545
"coordinates": [1355.400544, 5255.530286]
4646
}
@@ -69,6 +69,48 @@ GET /example/_search
6969
}
7070
--------------------------------------------------
7171

72+
////
73+
[source,console-result]
74+
--------------------------------------------------
75+
{
76+
"took": 3,
77+
"timed_out": false,
78+
"_shards": {
79+
"total": 1,
80+
"successful": 1,
81+
"skipped": 0,
82+
"failed": 0
83+
},
84+
"hits": {
85+
"total": {
86+
"value": 1,
87+
"relation": "eq"
88+
},
89+
"max_score": 0.0,
90+
"hits": [
91+
{
92+
"_index": "example",
93+
"_type": "_doc",
94+
"_id": "1",
95+
"_score": 0.0,
96+
"_source": {
97+
"name": "Lucky Landing",
98+
"geometry": {
99+
"type": "point",
100+
"coordinates": [
101+
1355.400544,
102+
5255.530286
103+
]
104+
}
105+
}
106+
}
107+
]
108+
}
109+
}
110+
--------------------------------------------------
111+
// TESTRESPONSE[s/"took": 3/"took": $body.took/]
112+
////
113+
72114
==== Pre-Indexed Shape
73115

74116
The Query also supports using a shape which has already been indexed in

0 commit comments

Comments
 (0)