pelias-query
Advanced tools
Comparing version 8.13.0 to 8.14.0
@@ -442,2 +442,24 @@ // This query is used for component geocodes, where the individual fields have | ||
function addPostCode(vs) { | ||
var o = addPrimary( | ||
vs.var('input:postcode').toString(), | ||
'postalcode', | ||
[ | ||
'parent.postalcode' | ||
], | ||
false | ||
); | ||
// same position in hierarchy as borough according to WOF | ||
// https://github.com/whosonfirst/whosonfirst-placetypes#here-is-a-pretty-picture | ||
addSecLocality(vs, o); | ||
addSecCounty(vs, o); | ||
addSecRegion(vs, o); | ||
addSecCountry(vs, o); | ||
return o; | ||
} | ||
Layout.prototype.render = function( vs ){ | ||
@@ -457,2 +479,5 @@ var q = Layout.base( vs ); | ||
} | ||
if (vs.isset('input:postcode')) { | ||
funcScoreShould.push(addPostCode(vs)); | ||
} | ||
if (vs.isset('input:neighbourhood')) { | ||
@@ -459,0 +484,0 @@ funcScoreShould.push(addNeighbourhood(vs)); |
{ | ||
"name": "pelias-query", | ||
"version": "8.13.0", | ||
"version": "8.14.0", | ||
"description": "An Elasticsearch query builder for Pelias", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -63,2 +63,21 @@ { | ||
} | ||
}, | ||
{ | ||
"bool": { | ||
"_name": "fallback.postalcode", | ||
"must": [ | ||
{ | ||
"multi_match": { | ||
"query": "postcode value", | ||
"type": "phrase", | ||
"fields": ["parent.postalcode"] | ||
} | ||
} | ||
], | ||
"filter": { | ||
"term": { | ||
"layer": "postalcode" | ||
} | ||
} | ||
} | ||
} | ||
@@ -65,0 +84,0 @@ ] |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
288873
8050