stac-utils / pgstac

Schema, functions and a python library for storing and accessing STAC collections and items in PostgreSQL
MIT License
153 stars 39 forks source link

add q parameter for free-text search #295

Closed hrodmn closed 3 months ago

hrodmn commented 3 months ago

This adds the q parameter for free-text search. It will be pretty slow for item-level search because it has to compute the tsvectors on-the-fly, but it works great for collection-level search where the number of records should be limited.

Resolves #293 (for collection-level search at least)

hrodmn commented 3 months ago

@bitner I had to beef up q_to_tsquery a bit to avoid replacing terms inside of quoted statements. It's all case-insensitive now and passing a more robust set of tests!