Server Customization

All clean. Changes applied:

FileChange
constants.pyRemoved infix: True from keywords (general) and keywords/friend_keywords (friend) — i`nfix kept only on tags
general_query.pyOverride search_params adds query_by_weights: “2,1" (keywords ranked above tags)
general_query.pySame override adds facet_by: obj_type — free per-type result counts
search_query.pydrop_tokens_threshold: 2 — prevents zero-result pages
search_query.pytypo_tokens_threshold: 2 — applies typo tolerance only where needed
search_query.pyhighlight_fields set to query_by value + highlight_affix_num_tokens: 4 — reduces response payload

typo_tokens_threshold

  • 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.”

drop_tokens_threshold

— 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.

Example

  • num_typos=1 fixes photgraphy → photography
  • typo_tokens_threshold=2 means: if < 2 results found without typos, retry with num_typos applied
  • drop_tokens_threshold=2 means: if still < 2 results, try dropping natur and searching just photography