-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Description
The logic that handles free-text queries was not working as expected when either title or keywords was null:
pgstac/src/pgstac/sql/004_search.sql
Lines 221 to 230 in 6da165b
| where_segments := where_segments || format( | |
| $quote$ | |
| ( | |
| to_tsvector('english', content->'properties'->>'description') || | |
| to_tsvector('english', content->'properties'->>'title') || | |
| to_tsvector('english', content->'properties'->'keywords') | |
| ) @@ %L | |
| $quote$, | |
| ft_query | |
| ); |
The test cases that I added all had title, description, keywords filled out so the null cases were never tested!
pgstac/src/pgstac/tests/basic/free_text.sql
Lines 21 to 52 in 6da165b
| ( | |
| 'Stranger Things', | |
| 'Some teenagers drop out of school to fight monsters', | |
| 'monster, scary, dark, 80s', | |
| -180, -90, 180, 90, | |
| '2016-01-01T00:00:00Z', | |
| '2025-12-31T23:59:59Z' | |
| ), | |
| ( | |
| 'The Bear', | |
| 'Another story about why you should not start a restaurant', | |
| 'restaurant, funny, sad, great', | |
| -180, -90, 180, 90, | |
| '2022-01-01T00:00:00Z', | |
| '2025-12-31T23:59:59Z' | |
| ), | |
| ( | |
| 'Godzilla', | |
| 'A large lizard takes its revenge', | |
| 'scary, lizard, monster', | |
| -180, -90, 180, 90, | |
| '1954-01-01T00:00:00Z', | |
| null | |
| ), | |
| ( | |
| 'Chefs Table', | |
| 'Another great story that make you wonder if you should go to a restaurant', | |
| 'restaurant, food, michelin', | |
| -180, -90, 180, 90, | |
| '2019-01-01T00:00:00Z', | |
| '2025-12-31T23:59:59Z' | |
| ); |
Metadata
Metadata
Assignees
Labels
No labels