matthias.oberleitner
Hi, I’m evaluating Ash as a foundation for our future business applications.
So far I love it, and there’s just one usecase I haven’t been able to solve yet.
We’d like to be have a search bar where we can search across multiple resources and multiple of their attributes. It would be a real banger if we could use the security aspects of ashs resources with policies and field policies applied to that search, so you don’t have to reimplement it manually in an external system like typesense / elasticsearch, and you can’t accidentally find something in the search you’re not supposed to be able to see.
Has anyone done anything like this? Either in the postgres db attached, or with an external search engine like typesense / elasticsearch etc.
For the DX I would imagine having an extra block in the resources something like…
global_search do
indexed_attributes :product_description, :product_slug, :product_number
index_functions # add a function where the resource gets passed and you can return extra fields etc
end
(note I haven’t touched elixir in 2 years where I just learned it for a couple months in my spare time, so see this as pseudo code ^^)
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #elixirconf-us
- #podcasts-by-brainlid
- #blog-post
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #elixirconf-eu
- #processes
- #security
- #api
- #forms
- #performance










Showing Posts 1 to 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
dbaer
Hi Matthias, I recalled a library yesterday that already supports this but had to find it again: Search_ash - multilingual Postgres full-text search for Ash
nseaSeb
Thanks a lot; I set this up for an Ash project, in a context where I didn’t want to use Elasticsearch. Feel free to contribute if you’d like, or to let me know about any bugs or missing features.
Wishing you all the very best.
manhvu
Currently, I haven’t found any library that supports this feature. So, I built my own full-text search engine and used Ash notifications to keep the search documents in sync with resource changes (insert/update).
I also developed AshScylla, which includes a lightweight search engine built on ScyllaDB using an inverted index.
However, this was built to meet my MVP requirements, so it still needs more testing in production.