Changelog

View Source

All 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.Repo now names Dowser.OpenSearch.Migration.Adapter (__migration_adapter__/0), which runs dowser_client's migrations (Dowser.Migration, mix dowser.migrate) against OpenSearch: tracking and lock in the dowser_schema_migrations index, copies through _reindex followed with the tasks API, write blocks through the add-block API.
  • Formatter export. import_deps: [:dowser_opensearch] in an application's .formatter.exs keeps 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 an Ecto.Repo; see Dowser.Repo. config :dowser_opensearch, default_repo: MyApp.Search is the repo a call without :repo goes to. With verify: true the repo checks at startup that its endpoint is OpenSearch (GET /), and engine/0 returns 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}). See Dowser.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 a Dowser.Mapping module or a document module, not only a map) and :unknown_fields (:raise returns a Dowser.UnknownFieldError for a field the mapping doesn't declare). :struct and :mapping turn 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 — a Dowser.Mapping module, 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_range is cast to a Range, like integer_range.
  • NaiveDateTime and Time dates, for fields formatted strict_date_hour_minute_second(_millis) and strict_hour_minute_second(_millis).

Changed

  • Breaking: requires dowser_client ~> 0.4.0.
  • Breaking: casting against the cluster's mappings with no Dowser.OpenSearch.MappingCacher started returns a Dowser.MappingError naming it — it used to leave every value uncast without a word.
  • Breaking: the :context option is now :repo on every API function, and named contexts (config :dowser_client, contexts: [...]) are gone: define a repo, and set :default_repo. A call that still passes :context returns 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) and strict_hour_minute_second(_millis); see Dowser.Type.Date. Any other format — including none, which OpenSearch reads as strict_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_range needs strict_date, an integer_range/long_range integer gte/lte bounds. Anything else comes back as stored.
  • Breaking: custom field codecs implement @behaviour Dowser.Type and delegate to Dowser.Type.load/2 and Dowser.Type.dump/2.
  • Breaking: the :codec option is :types — per request, on the codec, and in config :dowser_opensearch, .... One still set to :codec is an error naming :types.
  • Breaking: Dowser.OpenSearch.MappingCacher.put/3 takes repo:, and raises without one — it used to store nothing when no :default context existed.
  • The mapping decides what a value is, never its shape. A geo_point stored as an object now loads to {lat, lon}; a map its type leaves uncast (a geo_shape, an integer_range with float bounds) has its keys go through :keys; a field the mapping doesn't know is left as it is.
  • Breaking: only flat_object is opaque — flattened is Elasticsearch's type, and is now cast like any other.
  • A struct sent as a document is cast against the mapping, as dowser_elasticsearch already 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.MappingCacher to its own supervision tree; config :dowser_opensearch, mapping_cacher_opts: [...] becomes that child's options.
  • Breaking: Dowser.OpenSearch.Codec.Date, .Binary, .DateRange, .GeoPoint, .IP and .Range — they are Dowser.Type.Date and so on in dowser_client. Dowser.OpenSearch.Codec no longer has load/2, dump/2 or a behaviour of its own.
  • Breaking: Dowser.OpenSearch.MappingError — it is Dowser.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.* to Dowser.OpenSearch.*; update the aliases and calls in your code. The application name, its config :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:

Added — supporting layer

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 to Dowser.OpenSearch.Target.
  • Dowser.OpenSearch.Streamer requires a sort. Elasticsearch has a _shard_doc sort field made for tiebreaking a point-in-time walk, which its streamer appends for you. OpenSearch forked before that existed and never added it, and search_after on 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_time rather than /_pit, and the id is named pit_id; a delete wants it as an array, so delete_pit/2 wraps a single id.
  • By-query operations are Reindex, not Document. OpenSearch tags _delete_by_query, _update_by_query and _reindex together.
  • validate_query is a search endpoint here, where Elasticsearch tags it indices.
  • No remove_block. OpenSearch has no endpoint for it; clear the corresponding index.blocks.* setting instead.
  • flat_object is treated as opaque alongside Elasticsearch's flattened, so its keys never reach the atom table.