Skip to content

agile-learning-institute/archived-mh-search-opensearch

Repository files navigation

mentorhub-search-elasticsearch

This repository manages the configuration and test data for the Elasticsearch search system used in the MentorHub project. It consists of two containers. The first container starts the elasticsearch container. The second container initializes the index and mapping scripts, ensuring a ready-to-use environment for data, optionally loading test data. This dual-container setup provides a comprehensive solution for managing the Elasticsearch database, making it easy to deploy, configure, and populate with test data. When deployed into a production environment, we can utilize the second container with a different backing service, i.e. live elasticsearch

Here are all of the repositories in the mentorHub system

DISCLAIMER

The Elasticsearch container is quite big, roughly 1.3 GB. This might present a problem for those on a metered connection looking to contribute.

Prerequisites

Optionally

Customize configuration

See Tsconfig Reference

Contributing

The typescript files found in ./src/searchinit/ are used to grab test data from a test-data.json and perform the necessary data transformations before indexing the test data. There is a CLI tool at./src/searchinit/elasticsearch-test.sh that can be used to run various tests on your elasticsearch container.

You should do all work in a feature branch, and when you are ready to have your code deployed to the cloud open a pull request against that feature branch. Do not open a pull request without first building and testing the containers locally.

Testing changes locally

Run this from the project root directory (mentorhub-search-elasticsearch). This command creates an elasticsearch container then builds, bundles, and tests migrate.ts This is what you will use to test changes locally.

./src/searchinit/localtest.sh

Build and test the container

Use the following command to build and run the container locally. See here for details on how to stop/start mentorhub containers.

./src/docker/docker-build.sh

After that command completes successfully you can verify it worked successfully by entering the following command

 curl https://localhost:9200 -ku 'admin:admin'

If you don't get a response, you can follow this guide to troubleshoot. With a working container, you can make use of these tools

./src/searchinit/localtest.sh
./src/searchinit/elasticsearchtest.sh

About

mh search database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 2

  •  
  •