Improve FTS search: ordering, result limits and 2-column display#6733
Improve FTS search: ordering, result limits and 2-column display#6733meyerlor wants to merge 1 commit into3liz:masterfrom
Conversation
meyerlor
commented
Apr 13, 2026
- Switch similarity() to word_similarity() so short search terms (e.g. "106") score equally for all labels containing the term as a whole word, letting the secondary ORDER BY item_label produce a clean alphabetical list
- Raise SQL fetch limit (40→500), per-layer cap (30→50) and total cap (60→100) to prevent late-alphabet results being silently dropped
- Widen search panel (max-width 70%→85%), cap height at 95%
- Apply 2-column layout via CSS :has() only when a category has 11+ results; each item is capped at 280px with word wrapping
- Switch similarity() to word_similarity() so short search terms (e.g. "106") score equally for all labels containing the term as a whole word, letting the secondary ORDER BY item_label produce a clean alphabetical list - Raise SQL fetch limit (40→500), per-layer cap (30→100) and total cap (60→200) to prevent late-alphabet results being silently dropped - Widen search panel (max-width 70%→85%), cap height at 95% - Apply 2-column layout via CSS :has() only when a category has 11+ results; each item is capped at 280px with word wrapping
|
I admit this is maybe questionable, and especially the values how many results per layer / in total should be displayed is set kind of randomly. But imho, this improves the search a bit for imprecise search terms, giving more results in a 2-column layout. No hard feelings if you reject this! |
|
Love it ! |
|
We should really activate autocompletion for these searches. Not trivial to do since there are different providers, but it would be awesome to have. I built a quick hack for this website : See the related files
This is just to see "what it could do". The code is quite old and not really maintained (some ref to OpenLayers 2 functions ...) |
|
ouhw, autocomplete would be loveley, indeed. I had it not on my list but now that you mention it..! What i had on my list was "upward pointing children search" (dunno how to explain it - search for a child of a 1:n related relation, get the parent feature as result) |
Nice to have too ! |
|
The site is down (or i can not access it?) but i'm going through your files now. I'll draft a dedicated PR for autocompletion if i can make it work! |