avulfson17
d43a16f780
Add borough as a possible layer for geonames
8 years ago
Alec Vulfson
2092cf2e15
Shows county in label if there isnt a locality or local admin
8 years ago
Alec Vulfson
35e548ef15
Updating list of layers for Geonames
8 years ago
Diana Shkolnikov
1435de906d
Add source_id property
9 years ago
Julian Simioni
9e12c650d0
Add logging helper module
...
This module has helper methods for logging. Currently it has methods to:
* detect if DNT is enabled
* remove sensitive information from input fields for logging
9 years ago
Stephen Hess
bd3b8e7bbe
switched to pelias-text-analyzer package since that responsibility has been moved to there
9 years ago
Stephen Hess
9cdfce13c1
fixed extraneous comma labels for results with only a `name`
9 years ago
Stephen Hess
2c40827701
added `layer=borough` support for *all 5 boroughs* in data
9 years ago
Stephen Hess
0076200728
added special case for USA in labels
...
if record is for literal United States, use the full name, otherwise use USA
9 years ago
Stephen Hess
c99fa9f0ef
added support for `macroregion`
9 years ago
Stephen Hess
8a54dbeef0
switched from `macrocountry` to `macrocounty`
9 years ago
Diana Shkolnikov
c415b96ead
Named admin_parts adminParts which caused problems
9 years ago
Stephen Hess
c5626d6c5e
added `localadmin` for USA/GBR/default when `locality` isn't available
9 years ago
Stephen Hess
8d0b0e8780
switched to `_.compact` to remove `undefined` values
9 years ago
Stephen Hess
0870e30366
Refactored the label generation code to be simpler
...
Labels are now, outside US/CA/UK, just name+city+country.
Deduping now only occurs on the first 2 parts of the labels which fixes the "Luxembourg, Luxembourg" issue.
9 years ago
Julian Simioni
39502df284
Add borough to geojson output and USA.local labels
9 years ago
Diana Shkolnikov
147c849b58
change admin property names to <place_type>_gid from <place_type>_id
9 years ago
Diana Shkolnikov
3862dd233e
change admin property names to <place_type>_gid from <place_type>_id
9 years ago
Diana Shkolnikov
928597e029
Fix admin parts parsing without spaces after delimeters
9 years ago
Diana Shkolnikov
7ebb653c22
Change properties.bounding_box to bbox at top level
9 years ago
Stephen Hess
5b934b27c3
removed debug
9 years ago
Stephen Hess
c746bd8d36
added `macroregion` to default and GBR schemas (with tests!)
9 years ago
Stephen Hess
fd0718a699
updated labelGeneration special case so that region-specific logic only applies to US/CA
9 years ago
Stephen Hess
77f396d5cb
exposed `macrocounty` and `macroregion` fields in geojsonify
9 years ago
Diana Shkolnikov
e17b940136
Compute extent bounding box and expose bounding_box property in results
9 years ago
Diana Shkolnikov
b2accb71e9
Get rid of QS references
9 years ago
Diana Shkolnikov
af8044ef29
Fix all unit tests
9 years ago
Diana Shkolnikov
7aeea99ea7
Remove quattroshapes and admin0/admin1 from layers
9 years ago
Diana Shkolnikov
b8ab7c00f7
Cleanup the label generation code just a bit
9 years ago
Diana Shkolnikov
4219cefd56
Add new parent properties and take the first one in each property if it is an array
9 years ago
Diana Shkolnikov
e14697fe40
Remove adminFields because it is not needed anymore
9 years ago
Julian Simioni
692b6da17d
Use layer instead of _type field to determine layer
9 years ago
Julian Simioni
ef78b2e0fd
Filter source and layer by new fields
...
This is functionally the same code as before, except that it uses the
new source and layer mapping.
9 years ago
Julian Simioni
cdd00af6bc
Build responses with new source and layer fields
...
There is no longer any ambiguity in the source field and the layer
(which is stored as _type), so a lot of logic to compute them can simply
read from the elasticsearch document. Hooray!
9 years ago
Stephen Hess
0f6059c05a
Refactored to use a function for looking up value for a label
...
The reason for this switch is that special case logic is needed to determine the US state name to display. All other fields can be looked up by name.
The burden of fallback functionality is now in `helper/labelSchema` so the burden of unit testing is now in `test/unit/helper/labelSchema.js`
9 years ago
Stephen Hess
431fe44f05
converted labelSchema to .js with module.exports
...
this is in preparation to introduce functions into the schema instead of strings
9 years ago
Stephen Hess
7b5b9dee61
added comments illustrating the subtleties of label generation
9 years ago
Stephen Hess
5456632cdf
Added flag to not include `default.name` in label
...
when source=`geonames` or `whosonfirst` and layer=`region`
This will stop, say, a search for "New Mexico" resulting in the label "New Mexico, NM, USA"
9 years ago
Stephen Hess
3e11e6687c
added `country_a` to label for all USA results
9 years ago
Stephen Hess
3e8d1bfd9b
broke country-specific label tests out to own file for easier testing
9 years ago
Stephen Hess
515d4aeb94
extracted `getSchema` helper method
9 years ago
Julian Simioni
769f190eab
Replace depricated Lodash function unique with uniq
...
See https://github.com/lodash/lodash/wiki/Changelog#jan-12-2016--diff--docs
9 years ago
Julian Simioni
cb7b38bc75
Replace check-types depricated unemptyString with nonEmptyString
...
See https://www.npmjs.com/package/check-types#what-changed-from-4x-to-5x
9 years ago
Julian Simioni
f4a5dd812b
Replace depricated Lodash function contains with includes
...
See https://github.com/lodash/lodash/wiki/Changelog#jan-12-2016--diff--docs
9 years ago
Diana Shkolnikov
9fa5fc5a77
calcSize became middleware (exposed and fixed bug in query defaults)
9 years ago
Diana Shkolnikov
54187dde67
Add dedupe middleware
...
Dedupe middleware removes __exact__ dupes and truncates the results
to the specified size.
9 years ago
Peter Johnson
c17a0dbc54
increase postcode weights, add postcode to leftovers
9 years ago
Julian Simioni
db895c05b7
Rename `from_address_parser` key to `from_text_parser`
9 years ago
Julian Simioni
59b70f7c7e
Rename helper/query_parser to helper/text_parser
9 years ago
Julian Simioni
8f1c8f4d89
Add helpful comments in various query parser locations
9 years ago