Hi,
I wrote longer article about multiple approaches for search in PostgreSQL and Ecto/Elixir. There are example in SQL and also in Ecto syntax.
I tried to describe main possible options for full text search, Semantic search with OpenAI Embeddings and later combinations of those approaches. Also I mentioned some hints, tricks and a lot of links to some interesting readings. To give readers also another options than PostgreSQL I mentioned some other services/systems which can be used.
Search is not magic with PostgreSQL
https://blog.ideax.sk/search-is-not-magic-with-postgresql-613069cb2f21