Releases: simonleva/knitsearch
Releases · simonleva/knitsearch
Release list
v0.1.1
Changelog
v0.1
multisearchable(against:)— global multi-model search macro. Declares which columns to index inknitsearchesFTS5 table.Knitsearch.multisearch(query, limit:)returns BM25-ranked polymorphic Document relation. Independent from per-modelsearchable_by; both can coexist on the same model with zero extra sync cost.- Fix after_save_commit callback silently no-op'ing for has_many associated_against — bundled callback registration and method definition into an ActiveSupport::Concern's
included doblock to fix callback-chain compilation timing. dictionary: "trigram"exposes FTS5's built-in trigram tokenizer for substring search. Zero new dependencies. Cannot be combined withprefix:.search(query, match: :phrase)requires tokens to appear as a contiguous, ordered phrase via FTS5's native phrase queries. Cannot be combined withoperator: :or.search(query, fallback_below: N)— Searchkick-style two-pass fallback. Runs a strict AND search first; if fewer than N results, automatically retries withoperator: :orand merges. Returns anArrayinstead of aRelationwhen used. No-op when combined withoperator: :or.Model.suggest(query, limit: 10, fallback_below: nil)— Autocomplete convenience method. Delegates tosearch(..., prefix: true)with a sensible default limit. BM25-ranked results are chainableActiveRecord::Relations.searchable_by(associated_against: { assoc: [:column] })— Index fields from belongs_to, has_many, and has_many :through associations. Parent updates cascade to children (belongs_to) or child/join changes refresh parent (has_many, has_many :through). Target updates refresh all parents with that target (has_many :through only).
v
Changelog
v0.1
multisearchable(against:)— global multi-model search macro. Declares which columns to index inknitsearchesFTS5 table.Knitsearch.multisearch(query, limit:)returns BM25-ranked polymorphic Document relation. Independent from per-modelsearchable_by; both can coexist on the same model with zero extra sync cost.- Fix after_save_commit callback silently no-op'ing for has_many associated_against — bundled callback registration and method definition into an ActiveSupport::Concern's
included doblock to fix callback-chain compilation timing. dictionary: "trigram"exposes FTS5's built-in trigram tokenizer for substring search. Zero new dependencies. Cannot be combined withprefix:.search(query, match: :phrase)requires tokens to appear as a contiguous, ordered phrase via FTS5's native phrase queries. Cannot be combined withoperator: :or.search(query, fallback_below: N)— Searchkick-style two-pass fallback. Runs a strict AND search first; if fewer than N results, automatically retries withoperator: :orand merges. Returns anArrayinstead of aRelationwhen used. No-op when combined withoperator: :or.Model.suggest(query, limit: 10, fallback_below: nil)— Autocomplete convenience method. Delegates tosearch(..., prefix: true)with a sensible default limit. BM25-ranked results are chainableActiveRecord::Relations.searchable_by(associated_against: { assoc: [:column] })— Index fields from belongs_to, has_many, and has_many :through associations. Parent updates cascade to children (belongs_to) or child/join changes refresh parent (has_many, has_many :through). Target updates refresh all parents with that target (has_many :through only).