engineeringdept
Snap - an Elasticsearch client for Elixir
I’ve just released the first version of Snap, an Elasticsearch client. It borrows ideas about application structure and process management from Ecto, as well as a DSL-free nature and zero-downtime index management from Elasticsearch.
It adds support for using Streams to perform bulk operations against an index, as well as emitting Telemetry events.
It’s new and probably not production ready yet. I expect to introduce it into a production environment in the coming weeks, and expect some changes will follow.
Please feel free to kick the tyres on it, and see if it’s useful for you. Feedback welcome!
Most Liked
engineeringdept
Hi there - the library is in production use and has been actively developed since my posting. I believe other people are also using it now.
engineeringdept
0.6.0 is out which supports the ability to swap HTTP clients, allowing mock HTTP clients for testing, or to use your preferred HTTP client for whatever reason. It still defaults to using Finch.
Full changelog here: snap/CHANGELOG.md at main · breakroom/snap · GitHub
engineeringdept
I’ve just released Snap 0.9.0, which adds support for the Document API in Snap.Document, exposes a Snap.Search.count function for counting documents in an index, and some quality of life and testing improvements with an index namespacing feature.
The index namespacing feature allows a Snap.Cluster to be isolated on a per-application or per-environment basis so you can have your dev environment indexes be prefixed with dev- and your test environment be prefixed with test- etc.
It also allows us to isolate indexes on a per-process basis, which enables asynchronous tests to be isolated from each other, so they operate on their own view of the cluster’s indexes. This is similar to how Ecto sandboxing works, but within the constraints of ElasticSearch/OpenSearch which doesn’t support transactions.
This makes it possible to set async: true in your tests which is often a nice performance improvement.
I’m really open to feedback on this API - let me know if it does what you expect, in the way you expect it!
For more details see Snap.Cluster.Namespace and Snap.Test.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








