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
Peter Johnson
b5b8647f0c
more label improvements
9 years ago
Julian Simioni
fef92bd34b
Remove the geoname _type from all layers except venue
...
We can't distinguish between geonames of different layers due to an
ambiguity in our Elasticsearch schema that we unfortunately won't be
able to fix for a few weeks.
So, while it's technically true that there are countries, cities, etc
contained in the geonames dataset, it's still better for now to remove
geonames from these layers. We have good coverage of most coarse layers
from quattroshapes alone, so the impact isn't too bad.
9 years ago
Peter Johnson
84dfa0f45e
add custom singapore schema, it is unusual as it is both a city and a country
9 years ago
Peter Johnson
3a54a8b32f
fix label issues
9 years ago
Peter Johnson
2b9c3d79aa
rename outputGenerator -> labelGenerator
9 years ago
Julian Simioni
e157749de3
Use _.contains instead of .indexOf
9 years ago
Julian Simioni
7b9d61c5ec
Use lodash intersection method
9 years ago
Julian Simioni
d4fff26574
Derive type, source, and layer list instead of hardcoding
9 years ago
Julian Simioni
da1314eeff
Add mapping function to get type from source and layer
9 years ago
Julian Simioni
b2f3b54f66
Leave only geonames specific mapping in gejsonify helper
9 years ago
Julian Simioni
fa44effdac
Add geoname type to most layers
...
The Geonames dataset includes lots of different kinds of places, so add
them to the mapping.
9 years ago
Julian Simioni
8b1037d7c8
Separate real layers and alias layers into separate objects
9 years ago
Julian Simioni
68c9661c70
Remove all mappings other than helper/type_mapping
9 years ago
Julian Simioni
4df0f98b14
Add type list, and raw mappings to/from source/layer and type
9 years ago
Julian Simioni
dc623d5af7
Send 3 part gid (source, layer, id) in GeoJSON responses
9 years ago
Diana Shkolnikov
553f9780c5
Remove admin matching when address is not parsed
9 years ago
Diana Shkolnikov
f1fdc2bc26
Remove categories from response json
9 years ago
Julian Simioni
509a6a7401
Remove geocoding block from properties in GeoJSON responses
...
All the attributes that were in this block are now put directly in the
GeoJSON properties object
9 years ago
Peter Johnson
a1efb0c6d0
lodash-ify some array functions; remove 'yes' and 'y' from thruthy
9 years ago
Diana Shkolnikov
c069933d5b
Refactored layers and sources into a common targets module
9 years ago
Diana Shkolnikov
67e034f5f2
Rename `source` to `sources`
...
... with a dash of refactoring thrown in for good measure
9 years ago
Diana Shkolnikov
dd78f324ee
Compute distance for each result of reverse query
9 years ago
Peter Johnson
2f8169ac10
remove unused sort conditions
9 years ago
Peter Johnson
22322eaa32
change param:input to param:text
9 years ago
Julian Simioni
139cb22127
Remove layers limiting on queries with few tokens
...
Primarily as a performance optimization, but also to attempt to return
more relevant results, only admin and POI layers were queried when the
text input consisted of only one or two tokens, and there weren't any
numbers. However as shown in #194 that is a bit too optimistic, mostly
in contries other than the USA.
Fixes #194
9 years ago
Harish Krishna
86424b8bbe
Rename `/search?input`, replacing it with '/search?text' parameter instead
...
changing parameter name input to text
https://github.com/pelias/api/issues/172
Rebased by @orangejulius
9 years ago
Julian Simioni
d45b09b0b3
Add comments to type helper
9 years ago
Julian Simioni
103a52cff5
Calculate intersection of types requested by source and layers params
9 years ago
Julian Simioni
2ebc935295
Rename query/indidces to query/types
...
It didn't really contain a list of indices.
9 years ago
Julian Simioni
258fa4390e
Move cmd.type setting logic to types helper
9 years ago
Julian Simioni
7a6ac8541b
Separate concerns of address parser
...
The address parser currently does two things:
1.) make some intelligent guesses as to possible admin regions to
explicitly search against to improve the quality of results returned
2.) make some intelligent guesses as to when no part of the query needs
to search against anything other than admin regions. This somewhat
improves the quality of results returned but mostly improves the speed
of the Elasticsearch query since it's searching significantly fewer
recoords.
These two concerns are now split into two separate methods within the
query_parser helper module. They are mostly independent today, but don't
have to be in the future.
9 years ago
Julian Simioni
0adc2821d2
Remove seemingly unhelpful comment
9 years ago
Julian Simioni
1fae622c39
Remove layer configuration based on address parsing
...
This code doesn't seem like it will be triggered very often (due to it
comapring space delimited words with comma delimited words from the text
field), and also has the potential to cause quite a bit of weird
behavior.
9 years ago
Julian Simioni
e71fb7cfd4
Whitespace
9 years ago
Julian Simioni
a479de7527
Calculate intersection of types requested by source and layers params
9 years ago
Julian Simioni
24349a3839
Rename query/indidces to query/types
...
It didn't really contain a list of indices.
9 years ago