Conversation
| @@ -1,9 +1,12 @@ | |||
| import { after, before, describe } from 'node:test'; | |||
|
|
|||
There was a problem hiding this comment.
Heads up that multiple files include simple prettier cleanup changes to clear up the repo (mostly order of imports, whitespace, & falsy handling) or Typescript updates to declutter the repo.
The main change is the creation of a SearchClient which replaces instances of ElasticSearch Client.
| const aggsState: I_AggsState[] = mappingToAggsState(mapping); | ||
| return { timestamp: timestamp(), state: aggsState }; | ||
| }; | ||
| (es: SearchClientType) => |
There was a problem hiding this comment.
All usage of @elastic Client is replaced by our SearchClientType
| const SearchClient = async (options: ESClientOptions | OSClientOptions) => { | ||
| const { ES_HOST } = ENV_CONFIG; | ||
| const searchConfig = await (await fetch(ES_HOST)).json(); | ||
| const { distribution } = searchConfig.version; |
There was a problem hiding this comment.
See:
https://docs.opensearch.org/latest/api-reference/cluster-api/info/
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-info
Cluster Info provides a distribution field which lets us clearly identify when an OpenSearch instance is running.
This will need to be expanded when investigating ElasticSearch 8. But for OpenSearch hopefully the distribution field will suffice.
| import { getProjectStorageMetadata, updateProjectIndexMetadata } from '../IndexSchema/utils'; | ||
| import { type AllClients } from '#searchClient/index.js'; | ||
|
|
||
| import { extendMapping } from '../../../mapping/index.js'; |
There was a problem hiding this comment.
With types cleaned up I found extendMapping is undefined, not sure what this is actually meant to be
There was a problem hiding this comment.
Main changes here
Summary
Base feature branch for supporting multiple Search client options in Arranger
Issues
Description of Changes
Setup
Requires running ElasticSearch / OpenSearch instances
Basic OpenSearch setup:
https://docs.opensearch.org/latest/getting-started/quickstart/#option-1-try-opensearch-in-one-command
Requires mock Arranger configs
... then run
npm run serverSuccessful connection to Arranger server with both OpenSearch and Elastic setups:
OpenSearch:

ElasticSearch:

Readiness Checklist
.env.schemafile and documented in the README