engineeringdept

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!

First Post!

cenotaph

cenotaph

Did you make any further progress on this?

Most Liked

engineeringdept

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

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

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.

Where Next?

Popular in Announcing Top

Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_orde...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
144 10847 141
New
mindok
What is ContEx? A pure Elixir server-side data plotting/charting library outputting SVG. It has nice barcharts in particular and works g...
New
tmbb
PhoenixWS - Websockets over Phoenix Channels Source code on Github here: GitHub - tmbb/phoenix_ws: Websockets implemented over Phoenix Ch...
New
brainlid
LangChain is short for Language Chain. An LLM, or Large Language Model, is the “Language” part. This library makes it easier for Elixir a...
New
Flo0807
Hello everyone! I am excited to share our heart project Backpex with you. After building several Phoenix applications, we realized that...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
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
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54260 488
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

We're in Beta

About us Mission Statement