Typesense Server (Search)
All clean. Changes applied:
| File | Change |
|---|---|
constants.py | Removed infix: True from keywords (general) and keywords/friend_keywords (friend) — i`nfix kept only on tags |
general_query.py | Override search_params adds query_by_weights: “2,1" (keywords ranked above tags) |
general_query.py | Same override adds facet_by: obj_type — free per-type result counts |
search_query.py | drop_tokens_threshold: 2 — prevents zero-result pages |
search_query.py | typo_tokens_threshold: 2 — applies typo tolerance only where needed |
search_query.py | highlight_fields set to query_by value + highlight_affix_num_tokens: 4 — reduces response payload |
- how many results must be found before Typesense stops applying typo tolerance.
- If the exact-match result count is below this threshold, it retries with typos enabled.
- Think of it as “only use typo tolerance if you’re not finding enough results.”
— how many results must be found before Typesense stops dropping tokens.
- For a multi-word query like “30 day plank challenge”, if results are below this threshold, Typesense will drop tokens (e.g. try “30 day plank”, then “day plank”, etc.) to find something rather than returning zero results.
num_typos=1fixes photgraphy → photographytypo_tokens_threshold=2means: if < 2 results found without typos, retry with num_typos applieddrop_tokens_threshold=2means: if still < 2 results, try dropping natur and searching just photography