Skip to content

refactor: migrate from Elasticsearch 6.8 to 9.2 and Node 18 to 24 #31

@MrOrz

Description

@MrOrz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    julesAsk jules to implement this ticket

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions