Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion layout/StructuredFallbackQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ function addHouseNumberAndStreet(vs) {
match_phrase('address_parts.number', vs.var('input:housenumber')),
match_phrase('address_parts.street', vs.var('input:street'), { slop: vs.var('address:street:slop') })
],
should: [],
should: [
// non-numeric tokens are stripped from the index, use the phrase field to improve sorting.
// see: https://github.com/pelias/pelias/issues/810
match_phrase('phrase.default', vs.var('input:housenumber'))
],
filter: {
term: {
layer: 'address'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
}
],
"should": [
{
"match_phrase": {
"phrase.default": {
"query": "house number value"
}
}
},
{
"match_phrase": {
"address_parts.zip": {
Expand Down
10 changes: 9 additions & 1 deletion test/fixtures/structuredFallbackQuery/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,15 @@
}
}
],
"should": [],
"should": [
{
"match_phrase": {
"phrase.default": {
"query": "house number value"
}
}
}
],
"filter": {
"term": {
"layer": "address"
Expand Down