Closed missinglink closed 5 years ago
I just added some unit tests for the 3 new methods on Document
.
In the process I decided to change the way the doc
pointer is passed to the scripts, instead of setting it as $this
I'm now passing it as the first argument, this is just less-fancy, more predictable and avoids unexpected behaviour when using arrow functions.
I've also added a couple additional assertions here-and-there.
Removed WIP label, happy to merge this code as-is @orangejulius.
rebased master
to resolve merge conflict.
This PR improves support for intersection matching in Pelias.
It introduces a new
layer
calledintersection
as well as a newaddress_parts
property calledcross_street
.I've also added a new concept within the
pelias/model
code which allow registering of "post-processing scripts" which are executed within thetoESDocument
function before being converted to the ES schema format.The
post/intersections.js
function I've added detects documents from theintersection
layer and adds additional name aliases as such:There are a few changes here so I'd appreciate some feedback before merging this. We discussed other places in the codebase where this code might live but in the end, decided that it would be nice to have it in
pelias/model
so it can be used by any importer.Intersection queries pose a few different issues, this PR will help improve the syntactic matching using name aliases, but it might be beneficial to address any vocab related issue in a
pelias/schema
PR (such asat vs @
and other common punctuation variations).WIP: waiting for feedback,
requires more unit tests to cover all functionality in PR (such as the 3 new methods on Document)