Sarah Hoffmann
96b6a1a418
use SearchDescription class in query loop
2017-10-08 09:54:12 +02:00
Sarah Hoffmann
0067555c38
move initial search setup to new class type
2017-10-07 12:24:21 +02:00
Sarah Hoffmann
c563c2bfec
drop searches with excluded country codes earlier
2017-10-07 12:23:46 +02:00
Sarah Hoffmann
266153f218
remove code for dropping address terms
...
This code has been inactive in quite a while and is a suboptimal
solution. We need to be much more selective in what gets dropped.
2017-10-07 11:53:33 +02:00
Sarah Hoffmann
73e737d775
fix variable names
2017-10-06 22:01:52 +02:00
Sarah Hoffmann
5029101048
further restrict use of partial terms in names
2017-10-06 21:36:28 +02:00
Sarah Hoffmann
0c9a241487
housenumbers may only appear before or after the name
2017-10-06 21:16:35 +02:00
Sarah Hoffmann
41d2cd318d
penalize search order where a country comes first
2017-10-06 21:07:33 +02:00
Sarah Hoffmann
0d2cdb5c2f
allow postcodes and housenumbers together
...
Fixes #805 .
2017-10-06 20:48:35 +02:00
Sarah Hoffmann
f8d55b5448
sanitize special search term before normalizing
2017-10-06 00:22:27 +02:00
Sarah Hoffmann
00a3a8834b
fix postcode search
...
Name token must be fully replaced with the postcode and
postcode search must be done only once.
2017-10-04 23:33:29 +02:00
Sarah Hoffmann
32f6ddf6db
only allow either postcode or special search
...
Fixes #804 .
2017-10-04 20:15:06 +02:00
Sarah Hoffmann
e3323e8888
fix search for postcode via structured query
...
Results from the artifical postcode table were dropped
when reevaluating rank of results.
2017-10-03 12:10:27 +02:00
Sarah Hoffmann
2deac34648
remove unnecessary size check
2017-10-02 22:31:52 +02:00
Sarah Hoffmann
e8c52c6780
be more strict with searches involving house numbers
...
Housenumber searches without a name cannot exist per
definition. Searches with only a name but no address
should not fall back on a search without house number.
This should improve postcode only search.
2017-10-02 22:22:50 +02:00
Sarah Hoffmann
e7e7ae0104
avoid unnecessary SQL when rechecking rank restrictions
2017-10-02 20:42:37 +02:00
Sarah Hoffmann
749091bf3a
order of viewbox coordinates does not matter
2017-10-01 22:48:57 +02:00
Sarah Hoffmann
a88527b2a0
fix index when rechecking postcode name
2017-09-30 12:19:16 +02:00
Sarah Hoffmann
b1e8db7ca7
return unchanged term if normalizer was not found
2017-09-30 09:39:47 +02:00
Sarah Hoffmann
15a215729e
fix handling of near queries with special search
...
Make sure to use the classtype tables with near search and
allow to search for arbitrary key/values (forbidding it
for viewbox searches).
Add tests for near queries.
2017-09-19 00:07:11 +02:00
Sarah Hoffmann
8eb066c692
reinstate key-value amenity search
...
Reenable search by the secret special term [key=value]
matching against the given main tag. Note that for most
cases that works only for tags that also have a special
search table.
2017-09-18 22:09:06 +02:00
Sarah Hoffmann
a0de20e9bc
more API tests for code coverage
...
Also fixes two minor issues related to structured queries.
2017-09-17 23:30:08 +02:00
Sarah Hoffmann
88610b1b74
further restrict results for <postcode>, <term>
...
Disallow postcode operator together with housenumbers
and force results around a postcode when no address is
given.
2017-08-21 22:29:51 +02:00
Sarah Hoffmann
86a8900e21
fix subqueries when getting details for postcodes
2017-08-19 19:37:06 +02:00
Sarah Hoffmann
67bb885900
throw away searches with two postcodes
2017-08-19 19:37:06 +02:00
Sarah Hoffmann
50c5abf6bb
fix API tests wrt postcodes
2017-08-19 19:37:06 +02:00
Sarah Hoffmann
5237f44c4a
remove lat/lon check for search terms
...
Was only used with GB postcodes which were removed.
2017-08-19 19:37:06 +02:00
Sarah Hoffmann
99e9abe843
require postcodes to match exactly in normalised form
2017-08-19 19:37:06 +02:00
Sarah Hoffmann
5b4bbab9be
include GB CodePoint data into location_postcode table
2017-08-19 19:37:06 +02:00
Sarah Hoffmann
3714b7ea7d
take postcode into account for other searches
...
Existence of postcode is still optional but if a matching
result is found, then non-matching ones will be discarded.
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
0ecb920866
immediately drop searches where requested country code does not match
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
563099f7fa
take address part into account in postcode search
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
57dc0304b5
add search for postcode
...
Implements the 'postcode' operator.
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
872e73314e
move postcodes into special operation for Searches
...
Introduces postcode field in searches and sorts out any marked
postcodes.
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
c13094acfd
limit number of considered places in POI queries
...
When searching for POIs in place_classtype_ tables limit the number
of objects considered to 300. The distinct and order by clauses
forced until now to retrive all matching objects and order them
first which can cause long running queries when retriving them
for large areas like the US.
Fixes #735 .
2017-06-05 22:40:42 +02:00
Sarah Hoffmann
54393addd3
disregard special phrases that do not match fully
...
Compare the normalized terms imported with the special
terms script with the normalized version of the query string.
Disregard them if they cannot be found. This avoids a significant
number of mismatches due to transliteration issues.
The match will only be done when a normalized word has been set
making this change backwards compatible with older databases.
2017-06-04 23:12:09 +02:00
Sarah Hoffmann
c8e79397f5
introduce address column for place tables
...
The column is a hstore containing the full OSM tag with key and
value.
2017-04-08 18:58:26 +02:00
Sarah Hoffmann
09f1661638
move moreURL computation into Geocode and include all params
...
Fixes #678 .
2017-03-23 00:16:58 +01:00
Sarah Hoffmann
e841422b1f
remove unused code
2017-03-22 23:02:19 +01:00
Sarah Hoffmann
57b35654e7
fix style
2017-03-17 22:36:22 +01:00
Sarah Hoffmann
ab3b556144
use NearPoint class in Search array
2017-03-16 22:04:30 +01:00
Sarah Hoffmann
41fce277cd
make NearPoint its own class
2017-03-15 23:47:35 +01:00
Sarah Hoffmann
450a12c6be
include housenumbers and postcodes when rechecking for exact matches
2017-02-28 21:40:05 +01:00
Sarah Hoffmann
c48fb88e6b
move interpolaton computation into indexing step
...
The interpolaton computation needs information from the osm2pgsql
slim tables which may not be available when the data is inserted.
Insertion now only adds a line with basic address information to
location_property_osmline. The line is then split during the
indexing, leading to more lines (which are complete in that case)
being inserted.
Fixes #598 .
2017-02-26 16:46:41 +01:00
Marc Tobias Metten
adb6ea546f
sMoreURL now includes countrycodes values
2016-12-22 02:06:08 +01:00
Sarah Hoffmann
cfb0f3f94c
Merge pull request #548 from lonvia/query-ckeck-utf8
...
check if query is valid unicode string
2016-11-02 19:21:29 +01:00
marc tobias
d93209ee48
Tiger: set osmtype=way and correct osm_id
2016-11-01 23:34:29 +01:00
marc tobias
eb79e655e6
cleanup of SQL for readability. No logic change
2016-11-01 23:33:47 +01:00
marc tobias
4f3074e538
cleanup of SQL for readability. No logic change
2016-11-01 23:33:47 +01:00
Sarah Hoffmann
1542a006cb
Merge pull request #550 from lonvia/decrease-line-length
...
Reduce maximum line length to 199
2016-10-16 09:55:13 +02:00