Preparation for a SearchAsh.GlobalIndex resource's :global_search action.
Hides archived rows (unless include_archived?: true), restricts to the given
types (when non-empty), then branches on the query term:
- blank/absent term — list the matching rows, unfiltered and unranked (a list UI before the user types);
- a term whose tokens are all eliminated (stopwords, too short:
"de") — no results, rather than the pre-0.4.0 behaviour of silently listing everything; - otherwise — filter on the tsvector match (plus, with
fuzzy? true, a trigram similarity/substring match on the folded label) and rank: label exact > starts-with > contains > body match (label_match_tier), thents_rank, then primary key.
Summary
Functions
Callback implementation for Ash.Resource.Preparation.init/1.
Callback implementation for Ash.Resource.Preparation.supports/1.
Functions
Callback implementation for Ash.Resource.Preparation.init/1.
Callback implementation for Ash.Resource.Preparation.supports/1.