Sarah Hoffmann
4a00a3c0f5
penalize name token splitting when phrases are used
2023-07-17 16:27:25 +02:00
Sarah Hoffmann
8366e4ca83
penalize search with frequent partials
...
Avoid search against frequent partials if we have already looked for
the full name equivalents.
2023-07-17 16:27:25 +02:00
Sarah Hoffmann
283db76e45
avoid splitting of first token when a housenumber is present
...
This only covers the case of <poi name> <street name> <housenumber>
which is exceedingly rare.
2023-07-17 16:27:25 +02:00
Sarah Hoffmann
8a36ed4f6f
increase threshold for full name searches
...
They still should be preferrred over expensive partial name searches.
2023-07-17 16:27:25 +02:00
Sarah Hoffmann
d0f45155c8
fix search for housenumber names
...
The search still included a lookup of housenumbers in children which is
wrong.
2023-07-17 16:27:25 +02:00
Sarah Hoffmann
7932b1849b
selected lambdas for search
2023-07-14 15:43:29 +02:00
Sarah Hoffmann
cc45930ef9
avoid lookup via partials on frequent words
...
Drops expensive searches via partials on terms like 'rue de'.
See #2979 .
2023-07-06 12:16:57 +02:00
Sarah Hoffmann
3266daa8fd
add a small penalty to lookups in address vectors
2023-07-04 16:54:42 +02:00
Sarah Hoffmann
49e0d83d5d
fix linting issues
2023-07-01 20:18:59 +02:00
Sarah Hoffmann
673c3c7a55
replace regexp_match with generic op() functions
...
Works around a bug in SQLAlchemy where regexp_match creates an
unstable cache key.
2023-07-01 18:15:22 +02:00
Sarah Hoffmann
5135041405
replace CASE construct with plpgsql function
2023-07-01 18:15:22 +02:00
Sarah Hoffmann
9f6f12cfeb
move search to bind parameters
2023-07-01 18:03:07 +02:00
Sarah Hoffmann
3a21999a17
move text normalization into extra function
2023-06-22 10:48:05 +02:00
Sarah Hoffmann
9bc5be837b
remove useless check
...
Found by new mypy version.
2023-06-21 11:56:39 +02:00
Sarah Hoffmann
4ad8818809
avoid fallback country lookup when places are excluded
2023-06-20 12:22:08 +02:00
Sarah Hoffmann
d0a1e8e311
tweak postcode search
...
Give a preference to left-right reading, i.e <postcode>,<address>
prefers a postcode search while <address>,<postcode> rather does
an address search.
Also exclude non-addressables, countries and state from results when a
postcode is contained in the query.
2023-06-20 11:56:43 +02:00
Sarah Hoffmann
3443d2c129
fix debug output for searches
...
Fields have been renamed.
2023-06-20 10:12:19 +02:00
Sarah Hoffmann
317cc5c544
make code backwards-compatible with older Python versions
2023-05-26 23:33:35 +02:00
Sarah Hoffmann
43c27dffd2
fix new linting warning
2023-05-26 16:31:43 +02:00
Sarah Hoffmann
146a0b29c0
add support for search by houenumber
2023-05-26 14:10:57 +02:00
Sarah Hoffmann
964bc7fbe0
ignore name rankings without variants
2023-05-26 13:53:34 +02:00
Sarah Hoffmann
dcfb228c9a
add API functions for search functions
...
Search is now split into three functions: for free-text search,
for structured search and for search by category. Note that the
free-text search does not have as many hidden features like
coordinate search. Use the search parameters for that.
2023-05-24 18:05:43 +02:00
Sarah Hoffmann
dc99bbb0af
implement actual database searches
2023-05-24 13:52:31 +02:00
Sarah Hoffmann
c42273a4db
implement search builder
2023-05-23 11:23:44 +02:00
Sarah Hoffmann
3bf489cd7c
implement token assignment
2023-05-22 15:49:03 +02:00
Sarah Hoffmann
d8240f9ee4
add query analyser for legacy tokenizer
2023-05-22 11:07:14 +02:00
Sarah Hoffmann
2448cf2a14
add factory for query analyzer
2023-05-22 09:23:19 +02:00
Sarah Hoffmann
004883bdb1
query analyzer for ICU tokenizer
2023-05-22 08:46:19 +02:00
Sarah Hoffmann
ff66595f7a
add data structure for tokenized query
2023-05-21 09:30:57 +02:00