agile-learning-institute / mentorHub-search-api

Apache License 2.0
1 stars 0 forks source link

Migrate API backing service from Opensearch to Elasticsearch #14

Closed MyNameIsAndrew-Mangix closed 4 months ago

MyNameIsAndrew-Mangix commented 5 months ago

Goal

The search database is being changed from Opensearch to Elasticsearch. The Elasticsearch docker images are nearly half the size of Opensearch, and we aren't missing out on anything Opensearch offers (to my knowledge). The /api/health and /api/config endpoints don't need to be changed for the migration. Requirements for the migration to be considered complete are listed below.

Expected behaviors

On calling the /api/search endpoint, the search needs to

  1. Establish a connection to the Elasticsearch backing service by initializing a client (client.ts)
  2. Get the query string from the request header query
  3. Use the client to search our index with a query that A) Supports partial searches i.e. Mich would yield Michael, Sar would yield Sarah, etc... B) Optionally search across different fields. Maybe you're searching for the name of a person, a curriculum, or a topic resource (we're looking to have the ability to specify fields via the request in the future).
  4. Return the results or error
  5. Close connection

Other requirements

Resources