Changelog
View SourceAll notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.4.0] - 2026-11-05
No breaking change: index migrations, from dowser_client 0.5.
Added
- Migrations. Every
use Dowser.OpenSearch.Reponow namesDowser.OpenSearch.Migration.Adapter(__migration_adapter__/0), which runsdowser_client's migrations (Dowser.Migration,mix dowser.migrate) against OpenSearch: tracking and lock in thedowser_schema_migrationsindex, copies through_reindexfollowed with the tasks API, write blocks through the add-block API. - Formatter export.
import_deps: [:dowser_opensearch]in an application's.formatter.exskeeps the migration DSL (add :status, ...) free of parentheses.
Changed
- Requires
dowser_client~> 0.5.0.
[0.3.0] - 2026-11-04
Breaking — see the upgrade guide for the path from v0.2.
Two changes, both following dowser_client 0.4: a cluster is now a repo of your
own instead of a context, and the casting moved to dowser_client, where
dowser_elasticsearch shares it. Dowser.OpenSearch.Codec and
Dowser.OpenSearch.MappingCacher stay, as OpenSearch's configuration of it.
Added
Dowser.OpenSearch.Repo: one module per cluster.use Dowser.OpenSearch.Repo, otp_app: :my_app, configured under your application and started in your supervision tree, like anEcto.Repo; seeDowser.Repo.config :dowser_opensearch, default_repo: MyApp.Searchis the repo a call without:repogoes to. Withverify: truethe repo checks at startup that its endpoint is OpenSearch (GET /), andengine/0returns the version it found. A repo also exposes the HTTP verbs, for endpoints this package doesn't cover.- Dynamic repos: the same repo module started under other names, each with
its own configuration — a cluster per tenant, say — chosen per process
(
put_dynamic_repo/1) or per call (repo: {MyApp.Search, :tenant_a}). SeeDowser.Repo. - More casting options. Every API call — and a repo's codec, and the
application environment — takes
:struct(load each document into a document module's struct, and dump it back),:mapping(now also aDowser.Mappingmodule or a document module, not only a map) and:unknown_fields(:raisereturns aDowser.UnknownFieldErrorfor a field the mapping doesn't declare).:structand:mappingturn casting on for that call even on a repo with no decoder configured. config :dowser_opensearch, mapping: ...sets the mapping source for the whole application — aDowser.Mappingmodule, say — in place of the cluster.- A Testing section in the README: stubbing the HTTP layer behind a repo, mocking the repo itself with Mox, and running against a real cluster.
long_rangeis cast to aRange, likeinteger_range.NaiveDateTimeandTimedates, for fields formattedstrict_date_hour_minute_second(_millis)andstrict_hour_minute_second(_millis).
Changed
- Breaking: requires
dowser_client~> 0.4.0. - Breaking: casting against the cluster's mappings with no
Dowser.OpenSearch.MappingCacherstarted returns aDowser.MappingErrornaming it — it used to leave every value uncast without a word. - Breaking: the
:contextoption is now:repoon every API function, and named contexts (config :dowser_client, contexts: [...]) are gone: define a repo, and set:default_repo. A call that still passes:contextreturns an error naming:repo. - Breaking: only nine date formats are cast —
epoch_millis,epoch_second,strict_date,strict_date_hour_minute_second(_millis),strict_date_time(_no_millis)andstrict_hour_minute_second(_millis); seeDowser.Type.Date. Any other format — including none, which OpenSearch reads asstrict_date_optional_time||epoch_millis— comes back as stored. A date is written at exactly its format's precision, and in UTC. - Breaking: a range is cast only when the Elixir struct holds it exactly: a
date_rangeneedsstrict_date, aninteger_range/long_rangeintegergte/ltebounds. Anything else comes back as stored. - Breaking: custom field codecs implement
@behaviour Dowser.Typeand delegate toDowser.Type.load/2andDowser.Type.dump/2. - Breaking: the
:codecoption is:types— per request, on the codec, and inconfig :dowser_opensearch, .... One still set to:codecis an error naming:types. - Breaking:
Dowser.OpenSearch.MappingCacher.put/3takesrepo:, and raises without one — it used to store nothing when no:defaultcontext existed. - The mapping decides what a value is, never its shape. A
geo_pointstored as an object now loads to{lat, lon}; a map its type leaves uncast (ageo_shape, aninteger_rangewith float bounds) has its keys go through:keys; a field the mapping doesn't know is left as it is. - Breaking: only
flat_objectis opaque —flattenedis Elasticsearch's type, and is now cast like any other. - A struct sent as a document is cast against the mapping, as
dowser_elasticsearchalready did: under an object it is turned into a map and walked; under a leaf it goes to its type.
Removed
- Breaking: the application callback, and with it the mapping cacher it
started on its own. An application that casts against the cluster's mappings
adds
Dowser.OpenSearch.MappingCacherto its own supervision tree;config :dowser_opensearch, mapping_cacher_opts: [...]becomes that child's options. - Breaking:
Dowser.OpenSearch.Codec.Date,.Binary,.DateRange,.GeoPoint,.IPand.Range— they areDowser.Type.Dateand so on indowser_client.Dowser.OpenSearch.Codecno longer hasload/2,dump/2or a behaviour of its own. - Breaking:
Dowser.OpenSearch.MappingError— it isDowser.MappingError.
[0.2.0] - 2026-10-27
The modules are renamed from Dowser.Opensearch.* to Dowser.OpenSearch.*,
following OpenSearch's own spelling. The package stays dowser_opensearch, and
the API itself is unchanged.
Changed
- Breaking: every module moved from
Dowser.Opensearch.*toDowser.OpenSearch.*; update the aliases and calls in your code. The application name, itsconfig :dowser_opensearch, ...keys and the[:dowser_opensearch, :mapping, :failure]telemetry event are unchanged. See the upgrade guide for the steps.
[0.1.0] - 2026-09-26
The first release: an Elixir client for the OpenSearch API, built on
Dowser.Client and modelled on
dowser_elasticsearch.
Added — API modules
One module per tag of the OpenSearch OpenAPI specification, each covering the common operations of its tag:
Dowser.OpenSearch.Alias— the atomicupdate_aliases/2plus the single-alias put/delete/get/exists set.Dowser.OpenSearch.Cat— all 24 CAT endpoints, including the OpenSearch-onlycluster_manager,pit_segmentsandsegment_replication.Dowser.OpenSearch.Cluster— health, state, stats, settings, reroute, allocation explain, and the OpenSearch-only weighted routing and decommission awareness.Dowser.OpenSearch.DanglingIndices— list, import and delete.Dowser.OpenSearch.DataStream— create, get, delete, stats and modify.Dowser.OpenSearch.Document— single-document CRUD, the exists/source pairs, bulk, multi-get and term vectors.Dowser.OpenSearch.Index— index lifecycle, the resize trio, rollover, the maintenance endpoints, the monitoring reads andresolve_index/2.Dowser.OpenSearch.IndexSettings— get and update.Dowser.OpenSearch.IndexStateManagement— the ISM policy endpoints andrefresh_search_analyzers/2.Dowser.OpenSearch.IndexTemplate— composable index templates, component templates and the legacy/_templateendpoints.Dowser.OpenSearch.Info—info/1and theping/1pair.Dowser.OpenSearch.List— OpenSearch's paginated counterpart to CAT indices and shards.Dowser.OpenSearch.Mappings— put, get and get-field.Dowser.OpenSearch.Reindex—_reindex, the two by-query operations and their_rethrottleendpoints.Dowser.OpenSearch.Search— search, msearch, count, explain, field caps, search shards, validate query, the template endpoints, scroll and point-in-time.
Added — supporting layer
- The transport foundation:
Dowser.OpenSearch.Client,Dowser.OpenSearch.Error,Dowser.OpenSearch.MappingErrorandDowser.OpenSearch.Target. - The type-casting layer:
Dowser.OpenSearch.Codecand its field codecs (Binary,Date,DateRange,GeoPoint,IP,Range), theMappabletraversal andDowser.OpenSearch.MappingCacher. - Bulk payload handling:
Dowser.OpenSearch.BulkandDowser.OpenSearch.BulkError, which report a bulk request's per-item failures. Dowser.OpenSearch.Repository— binds the index-related API functions to a fixed or computed index.Dowser.OpenSearch.Streamer— walks a search as a lazyStreamover a point in time, withstream_slices/4for the parallel case.
Notes for dowser_elasticsearch users
The API surface follows the same conventions, but OpenSearch is not Elasticsearch and a few things differ on purpose:
- Finer-grained modules. Elasticsearch tags index management, mappings,
settings, aliases and templates alike as
indices; OpenSearch splits them, so each gets its own module. The index-target helper they share moved from the indices module toDowser.OpenSearch.Target. Dowser.OpenSearch.Streamerrequires asort. Elasticsearch has a_shard_docsort field made for tiebreaking a point-in-time walk, which its streamer appends for you. OpenSearch forked before that existed and never added it, andsearch_afteron a non-unique final key silently skips or repeats documents — so the sort is the caller's to give, and a missing one raises rather than producing a walk that loses rows.- Point-in-time lives elsewhere.
/_search/point_in_timerather than/_pit, and the id is namedpit_id; a delete wants it as an array, sodelete_pit/2wraps a single id. - By-query operations are
Reindex, notDocument. OpenSearch tags_delete_by_query,_update_by_queryand_reindextogether. validate_queryis a search endpoint here, where Elasticsearch tags itindices.- No
remove_block. OpenSearch has no endpoint for it; clear the correspondingindex.blocks.*setting instead. flat_objectis treated as opaque alongside Elasticsearch'sflattened, so its keys never reach the atom table.