Skip to content

fix: add OpenSearch/Elasticsearch 7+ compatibility#54

Open
r4770 wants to merge 18 commits into
omc:masterfrom
italia:opensearch-compatibility
Open

fix: add OpenSearch/Elasticsearch 7+ compatibility#54
r4770 wants to merge 18 commits into
omc:masterfrom
italia:opensearch-compatibility

Conversation

@r4770
Copy link
Copy Markdown

@r4770 r4770 commented Jan 7, 2026

Summary

This PR updates the indexer to be compatible with OpenSearch and Elasticsearch 7+.

Changes

1. Mappings format

Before: Mappings were wrapped in a type (deprecated since ES 7):

{"mappings": {"_doc": {"properties": {...}}}}

After: Flat structure (ES 7+ / OpenSearch compatible):

{"mappings": {"properties": {...}}}

2. Bulk endpoint

Before: Included type in URL (deprecated):

POST /{index}/_doc/_bulk

After: Type-less endpoint (ES 7+ / OpenSearch compatible):

POST /{index}/_bulk

Compatibility

  • ✅ OpenSearch 1.x, 2.x
  • ✅ Elasticsearch 7.x, 8.x
  • ❌ Elasticsearch 6.x and earlier (EOL, not supported)

Related

Needed for https://github.com/italia/developers.italia.it to migrate from Elasticsearch to OpenSearch.

alranel and others added 18 commits February 6, 2019 00:02
…p; cache the list of old indices; exit with a non-zero code in case of fatal Elasticsearch errors; emit a warning upon index deletion failure
Fix random Elasticsearch errors
Managing ES authentication both from env var and uri params
Remove deprecated type-based mappings and bulk endpoint format.

- Remove type wrapper from mappings (was: {"mappings": {"_doc": {...}}})
  Now uses flat structure: {"mappings": {...}}
- Remove type from bulk endpoint (was: /{index}/_doc/_bulk)
  Now uses: /{index}/_bulk

These changes maintain backward compatibility with Elasticsearch 7+
while adding support for OpenSearch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants