Commit Graph

4292 Commits

Author SHA1 Message Date
Sarah Hoffmann
75139961a3 use constant expressions to select partial indexes in reverse
When expressions are generated with SQLAlchemy, any constants are
replaced with bind parameters. The bind parameters become parameters of
prepared statements. The result is that the query planner tends to
oversee that the partial indexes can be used.
2023-07-09 00:31:53 +02:00
Sarah Hoffmann
3e2dd59a94 remove disabling of prepared statements
Fixes for query planning with prepared statements to follow in
subsequent commits.
2023-07-08 15:59:15 +02:00
Sarah Hoffmann
c01386b5b4
Merge pull request #3107 from lonvia/performance-search
Assorted fixes to Python search code
2023-07-08 15:53:42 +02:00
Sarah Hoffmann
9cb8447673 increase minimum required SQLAlchemy version to 1.4.31 2023-07-06 14:15:51 +02:00
Sarah Hoffmann
e67355ab0e make get_addressdata calls cachable
VALUEs() is not a cachable construct in SQLAlchemy, so use arrays
instead. Also add a special case for single results, the usual result
for reverse queries.
2023-07-06 12:16:57 +02:00
Sarah Hoffmann
9cb9b670d1 add support for postcompile literals in debug output 2023-07-06 12:16:57 +02:00
Sarah Hoffmann
3e725bb2db fix SRID handling in Geometry type 2023-07-06 12:16:57 +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
ce17b0eeca
Merge pull request #3101 from lonvia/custom-geometry-type
Improve use of SQLAlchemy statement cache with search queries
2023-07-03 11:03:26 +02:00
Sarah Hoffmann
17a65d82bb make types compatible with older Python versions 2023-07-02 23:06:42 +02:00
Sarah Hoffmann
cc7646665c remove GeoAlchemy as dependency 2023-07-02 23:06:42 +02:00
Sarah Hoffmann
82216ebf8b always run function update on migrations
This means that we can have migrations which require nothing but
an update of the functions.
2023-07-01 20:18:59 +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
42631b85c7 band-aid for SQLAlchemy 1.4 2023-07-01 18:03:07 +02:00
Sarah Hoffmann
9f6f12cfeb move search to bind parameters 2023-07-01 18:03:07 +02:00
Sarah Hoffmann
6c4c9ec1f2 switch reverse() to new Geometry datatype
Also switches to using bind parameters for recurring parameters.
2023-07-01 18:03:07 +02:00
Sarah Hoffmann
4bb4db0668 introduce slim Geometry database type 2023-07-01 18:03:07 +02:00
Sarah Hoffmann
505fdd02ca
Merge pull request #3100 from lonvia/fix-name-merging-in-unnamed-boundaries
Fix merging of linked names into unnamed boundaries
2023-07-01 15:36:56 +02:00
Sarah Hoffmann
a873f260cf fix merging of linked names into unnamed boundaries
The NULL value of the boundaries' name field was erasing all
content when used in SQL operations.
2023-06-30 22:14:11 +02:00
Sarah Hoffmann
b45f761227
Merge pull request #3099 from lonvia/determine-place-address-from-tokenizer
Use information from tokenizer to determine street vs. place address
2023-06-30 21:47:57 +02:00
Sarah Hoffmann
d7a3039c2a also switch legacy tokenizer to new street/place choice behaviour 2023-06-30 17:03:17 +02:00
Sarah Hoffmann
6c5589c9d2 fix optional string representation or repr(PlaceName) 2023-06-30 11:10:44 +02:00
Sarah Hoffmann
645ea5a057 use information from tokenizer to determine street vs. place address
So far the SQL logic used the information from the address field
to determine if an address is attached to a street or place.
This changes the logic to use the information provided in the
token_info. This allows sanitizers to enforce a certain parenting
without changing the visible address information.
2023-06-30 11:08:25 +02:00
Sarah Hoffmann
2755ebe883
Merge pull request #3094 from lonvia/fix-failing-bdd-tests
Add BDD tests against Python frontend to CI
2023-06-22 22:28:31 +02:00
Sarah Hoffmann
4b829b5ff9
Merge pull request #3090 from mtmail/check-database-on-frozen-database
check-database on frozen db shouldnt recommend indexing
2023-06-22 20:11:30 +02:00
Sarah Hoffmann
ed19340af0 add python frontend tests to CI 2023-06-22 17:29:44 +02:00
Sarah Hoffmann
2d05ff0190 slightly adapt postcode tests 2023-06-22 16:51:59 +02:00
Sarah Hoffmann
0d338fa4c0 bdd: fix faking HTTP headers for python web frameworks 2023-06-22 14:00:33 +02:00
mtmail
15a66e7b7d
Merge branch 'osm-search:master' into check-database-on-frozen-database 2023-06-22 12:14:55 +02:00
Sarah Hoffmann
3a21999a17 move text normalization into extra function 2023-06-22 10:48:05 +02:00
Sarah Hoffmann
08dcd05d7b
Merge pull request #3093 from lonvia/remove-sanic
Remove support for Sanic
2023-06-22 09:55:32 +02:00
Marc Tobias
2337cc653b check-database on frozen db shouldnt recommend indexing 2023-06-21 17:47:57 +02:00
Sarah Hoffmann
0deb9262c9 use in operator for enum tests
Fixes a complaint by mypy.
2023-06-21 15:30:40 +02:00
Sarah Hoffmann
9bc5be837b remove useless check
Found by new mypy version.
2023-06-21 11:56:39 +02:00
Sarah Hoffmann
b79d5494f9 remove support for sanic framework
There is no performance gain over falcon or starlette but the special
structure of sanic makes it hard to have exchangable code
2023-06-21 10:53:57 +02:00
Sarah Hoffmann
ded2c5bf68 update project information for taginfo.json 2023-06-21 10:06:25 +02:00
Sarah Hoffmann
bd2c64876f
Merge pull request #3045 from biswajit-k/taginfo
Add script to generate taginfo project description
2023-06-21 10:01:40 +02:00
Sarah Hoffmann
7c66fef63f
Merge pull request #3091 from lonvia/fix-postcode-search
Assorted smaller fixes for Python-based search code
2023-06-20 16:13:20 +02:00
Sarah Hoffmann
4ad8818809 avoid fallback country lookup when places are excluded 2023-06-20 12:22:08 +02:00
Sarah Hoffmann
2f4342810d allow empty parts in excluded_place_id
This worked before.
2023-06-20 11:56:43 +02:00
Sarah Hoffmann
36df56b093 fix header name for browser languages 2023-06-20 11:56:43 +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
1b50381852 use string representation when dumping variables 2023-06-20 10:15:51 +02:00
Sarah Hoffmann
3443d2c129 fix debug output for searches
Fields have been renamed.
2023-06-20 10:12:19 +02:00
Sarah Hoffmann
1f83efa8f2
Merge pull request #3086 from lonvia/close-connection-on-replication
Close database connections while waiting for the next update cycle
2023-06-19 15:48:00 +02:00
Sarah Hoffmann
a7bd39b62a
Merge pull request #3087 from lonvia/conditional-spgist
Disable SPGist for PostgreSQL < 11
2023-06-19 15:47:37 +02:00
Sarah Hoffmann
1177b30a60
Merge pull request #3085 from lonvia/allow-brackets-in-password
Do not fail php script generation when curly braces are present
2023-06-19 14:44:22 +02:00