API Reference search_ash v#0.1.0

Copy Markdown View Source

Modules

An Ash extension that adds multilingual full-text search to a resource with one search do … end block.

Global change generated by SearchAsh. Keeps the search_text attribute in sync with the configured fields, stemmed in the row's language via SearchCore.

Ash extension that turns a resource into a unified, cross-entity search index — one row per indexed source object, searched with a single ranked query (Option B).

Read a resource's global_index do … end configuration.

Preparation for a SearchAsh.GlobalIndex resource's :global_search action. Hides archived rows (unless include_archived?: true), filters on the tsvector match, and ranks by ts_rank (prefix-aware, with a primary-key tiebreaker). A blank query lists the matching rows, unranked.

Adds the :upsert action, the :global_search read action, the :search_rank calculation, and default :read/:destroy actions to a SearchAsh.GlobalIndex resource (each only if absent).

Adds the index columns, the unique_source identity (tenant-aware) and the GIN index to a SearchAsh.GlobalIndex resource.

Read a resource's search do … end configuration.

Preparation generated by SearchAsh for the :search read action. Builds a tsquery from the query + language arguments (same SearchCore pipeline used at index time) and filters on the 'simple' tsvector of the search-text column.

Ash extension that mirrors a resource into a SearchAsh.GlobalIndex so it shows up in the unified global search.

Read a resource's searchable do … end configuration.

Adds the create/update sync change and the destroy remove change, and forces require_atomic? false on every update/destroy action.

Adds the :search read action (query + language args) unless already defined.

Adds the GIN expression index to_tsvector('simple', <search_text>) to the resource's Postgres custom_indexes, so migration generation emits and round-trips it. No-op for resources that are not backed by AshPostgres.

Adds a :search_rank calculation (ts_rank over the search-text tsvector, taking the built tsquery as an argument). The :search action loads and sorts by it. Skipped when rank? is false or a :search_rank calculation already exists.

Adds the search_text string attribute unless the resource already defines it.

Adds the global change that keeps search_text in sync on create/update.