Skip to content

Commit cc0f700

Browse files
committed
feat: 165: Update ES dataset, fix mapping
1 parent 4309638 commit cc0f700

7 files changed

Lines changed: 89 additions & 69 deletions

elasticsearch/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Vietnamese Provinces Database — Elasticsearch Dataset
22

3-
Created at: Sat, 25 Jul 2026 15:37:56 +0700
3+
Created at: Sat, 25 Jul 2026 17:59:15 +0700
44

55
## Overview
66

@@ -238,6 +238,26 @@ POST /provinces/_search
238238
}
239239
```
240240

241+
### Return only the matched ward (no parent province)
242+
243+
Use `_source: false` on the parent document so only the nested ward hit is returned:
244+
245+
```json
246+
POST /provinces/_search
247+
{
248+
"_source": false,
249+
"query": {
250+
"nested": {
251+
"path": "Wards",
252+
"query": { "match": { "Wards.CodeName": "truong_sa" } },
253+
"inner_hits": { "name": "ward", "_source": true }
254+
}
255+
}
256+
}
257+
```
258+
259+
The ward document (with GIS data if present) is available at `.hits.hits[0].inner_hits.ward.hits.hits[0]._source`.
260+
241261
### Autocomplete search
242262
```json
243263
POST /provinces/_search

0 commit comments

Comments
 (0)