Skip to content

Search Service for Swift: IIT Bhilai's campus delivery application.

Notifications You must be signed in to change notification settings

CS559-CSD-IITBH/search-service

Repository files navigation

Search Service

It is a Go-based service that provides search functionality using Elasticsearch for a collection of stores and their items.

Features

  • 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.

Prerequisites

Before running the service, make sure you have the following dependencies installed:

  • Go (version 1.20 or higher)
  • Elasticsearch (version 6.x)
  • Docker

Setup

  1. Clone the repository:

    git clone https://github.com/your-username/search-service.git
    cd search-service
    
  2. Add your personal MongoDB URL to the config.toml file in the monstache directory.

    mongo-url = <url for your personal mongo instance>
    
  3. 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> 
    
  4. Build the docker image for the api-service. Run the following command in the root directory.

    docker build -t search-service-api:latest .
    
  5. 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.

  6. 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!

About

Search Service for Swift: IIT Bhilai's campus delivery application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published