nseaSeb

nseaSeb

Search_ash 0.5.0 - synonym support + memory leak fix

Just published search_ash 0.5.0 (with search_core 0.4.0) on Hex.

What’s new: synonyms

You can now declare a synonym dictionary per language:

elixir

synonyms %{en: %{"cat" => ["kitten"]}}

Typing cat now builds a tsquery like (cat | kitten), matching documents whose search_text contains either. A few things worth knowing:

  • It’s dictionary-based, not semantic — the library doesn’t “know” cat and kitten are related, it applies exactly the mapping you give it.
  • It’s one-directional: "cat" => ["kitten"] means typing cat also finds kitten, not the reverse — add both directions if you want symmetry.
  • Stemming still applies on both sides, so plurals/inflections are handled automatically.
  • Synonyms only expand the full-text match + ranking (search_text/ts_rank) — they deliberately don’t affect the global-search label ranking tiers or fuzzy/typo matching, so an exact title match still ranks first.

This turns out to be pretty handy for domain acronyms too ("bl" => ["bon de livraison"], etc.) — not just lexical synonyms.

What’s fixed: a memory leak

Also fixed a subtle memory retention issue related to how Elixir handles large binaries — a small referenced binary was keeping a much larger one alive longer than necessary. Fixed by forcing a copy at the right point in the pipeline instead of holding a sub-binary reference.

Feedback welcome, as always — especially on the synonym API shape if anyone has strong opinions on bidirectional-by-default vs explicit.

repo: https://github.com/nseaSeb/search_ash

Most Liked

vicb335

vicb335

Oh wow! Pretty nice!

Where Next?

Popular in News & Updates Top

fhunleth
Nerves systems provide the operating system, libraries and other tools for building firmware for specific hardware. The Nerves Core Team ...
New
zachdaniel
Hey folks! I’ll be teasing some interesting bits going into Ash 3.0 while I work on it, and this is post #1! You can follow along with t...
New
zachdaniel
Ash Framework 3.0: Release Candidates! The day is finally here! This is the culmination of years of work from the Ash team and community ...
New
zachdaniel
The new Ash Framework site and installer are live. Please try it out and let me know what you think!
New
zachdaniel
Hey folks! I’ve begun putting together some concrete, framework-wide tooling and guidance on the usage of LLMs in development. The goal h...
New
zachdaniel
Hey folks! I’ve released the first version of our new AI policy. Accepting it is now part of our issue and pull request templates. Feel ...
New
bartblast
I’m excited to announce Hologram v0.5.0, a major evolution of the full-stack Elixir web framework! This release brings massive performanc...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New

We're in Beta

About us Mission Statement