Skip to content

Commit 0c510a3

Browse files
committed
feat(structured): use both parent.postalcode & address_parts.zip for postalcode subqueries.
1 parent e930786 commit 0c510a3

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

layout/StructuredFallbackQuery.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,8 @@ function addPostCode(vs) {
503503
vs.var('input:postcode').toString(),
504504
'postalcode',
505505
[
506-
'parent.postalcode'
506+
'parent.postalcode',
507+
'address_parts.zip'
507508
],
508509
false
509510
);

test/fixtures/structuredFallbackQuery/address_with_postcode.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@
7878
"multi_match": {
7979
"query": "postcode value",
8080
"type": "phrase",
81-
"fields": ["parent.postalcode"]
81+
"fields": [
82+
"parent.postalcode",
83+
"address_parts.zip"
84+
]
8285
}
8386
}
8487
],

test/fixtures/structuredFallbackQuery/postcode.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"query": "postcode value",
1515
"type": "phrase",
1616
"fields": [
17-
"parent.postalcode"
17+
"parent.postalcode",
18+
"address_parts.zip"
1819
]
1920
}
2021
}

0 commit comments

Comments
 (0)