Background
rumors-api is migrating from Elasticsearch 6.8 to 9.2 (see cofacts/rumors-api#381). Since this project connects to the same Elasticsearch cluster to export open data, we need to upgrade accordingly.
Changes Required
Dependencies
- Upgrade
@elastic/elasticsearch from ^6.8.6 to ^9.x
- Upgrade Node.js engine requirement from
>=18 to >=24
Code changes (dumpOpenData.js, dumpUser.js)
- Remove
body wrapper from responses: v9 client returns the result directly instead of { body: result }
// Before
const { body: result } = await client.search(...)
// After
const result = await client.search(...)
- Update
hits.total access: v9 returns { value, relation } object instead of a number
// Before
result.hits.total
// After
result.hits.total.value
Infrastructure
docker-compose.yml: Upgrade Elasticsearch image from elasticsearch-oss:6.3.2 to elasticsearch:9.2.2, add discovery.type=single-node, remove deprecated ES_JAVA_OPTS
.github/workflows/ci.yml: Update Elasticsearch service image to 9.2.2, update Node.js version to 24
Reference
Background
rumors-apiis migrating from Elasticsearch 6.8 to 9.2 (see cofacts/rumors-api#381). Since this project connects to the same Elasticsearch cluster to export open data, we need to upgrade accordingly.Changes Required
Dependencies
@elastic/elasticsearchfrom^6.8.6to^9.x>=18to>=24Code changes (
dumpOpenData.js,dumpUser.js)bodywrapper from responses: v9 client returns the result directly instead of{ body: result }hits.totalaccess: v9 returns{ value, relation }object instead of a numberInfrastructure
docker-compose.yml: Upgrade Elasticsearch image fromelasticsearch-oss:6.3.2toelasticsearch:9.2.2, adddiscovery.type=single-node, remove deprecatedES_JAVA_OPTS.github/workflows/ci.yml: Update Elasticsearch service image to9.2.2, update Node.js version to24Reference