CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.22k stars 97 forks source link

How to pass default filter conditions to the default UI? #581

Closed flyfoto closed 3 months ago

flyfoto commented 3 months ago

I couldn't find out how I could preset some filter conditions for a search in the default-UI.

I expected something similar to the method pagefindUi.triggerSearch(searchString) that allows to preset the search term.

Why? I save the current search (including filter conditions) in the URL and look for a way to reconstruct that search when opening that URL. E.G. https://fly-foto.de/luftbild/suche/?q=burg&Land=Frankreich&Jahr=2022

I don't want to switch from the default-UI to the JS-API.

May be this is a possible feature for the next release?

bglw commented 3 months ago

Yep, this is a good candidate for a feature alongside triggerSearch! I'll look into it.

bglw commented 3 months ago

This has landed in the v1.1.0 release 🎉