It is a Go-based service that provides search functionality using Elasticsearch for a collection of stores and their items.
- Elasticsearch with MongoDB: Utilizes Elasticsearch to perform efficient searches on store data. Using go-elasticsearch and Monstache for quick and easy integration with MongoDB.
- Gin Web Framework: Uses the Gin web framework for handling HTTP requests and responses.
- Structured Query: Supports structured queries, including nested queries. Integrated dashboard with Kibana.
Before running the service, make sure you have the following dependencies installed:
- Go (version 1.20 or higher)
- Elasticsearch (version 6.x)
- Docker
-
Clone the repository:
git clone https://github.com/your-username/search-service.git cd search-service
-
Add your personal MongoDB URL to the
config.toml
file in themonstache
directory.mongo-url = <url for your personal mongo instance>
-
Add a
.env
file in the root directory. It should contain the following fields.PORT=<port for the api-service> ELASTICSEARCH_URL=<url for your personal elasticsearch instance> MONGODB_URL=<url for your personal mongo instance> MONGODB_COLLECTION=<database-name.collection-name in your mongo instance>
-
Build the docker image for the api-service. Run the following command in the root directory.
docker build -t search-service-api:latest .
-
Start the services using docker-compose. Note that it is expected your Mongo is hosted on cloud.
sudo docker-compose compose build && sudo docker-compose up
When you start the services for the first time, your Elastic/Kibana credentials will be in the application logs, on your terminal screen.
-
After the services are up and running, you can visit the Kibana dashboard at http://localhost:5601/. Enter the credentials required. Now you can run queries!