Skip to content

jjacobsonn/in-memory-search-engine

Repository files navigation

In-Memory Search Engine

Python FastAPI Makefile Dockerfile Build Status License Stars Watchers Forks Releases

Search Engine Logo

A high-performance in-memory search engine using realistic search data inspired by daily software engineering tasks. The API provides both advanced autocomplete and fuzzy search endpoints, returning detailed metadata.

Features

  • Autocomplete Search: Fast prefix-based search using a Trie data structure.
  • Fuzzy Search: Typo-tolerant search using Levenshtein distance.
  • Detailed Metadata: Execution time, algorithm used, and more.

Live Demo

Screenshot of Site Home Page

Check out the live demo: In-Memory Search Engine

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/jjacobsonn/in-memory-search-engine.git
    cd in-memory-search-engine
  2. Create and activate a virtual environment:

    python3 -m venv env
    source env/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt

Running the Application

Using Uvicorn

Run the application locally using Uvicorn:

uvicorn api.app:app --host 0.0.0.0 --port 8000

Access the API at http://127.0.0.1:8000.

Using Docker

  1. Build the Docker image:

    docker build -t in-memory-search-engine .
  2. Run the Docker container:

    docker run -p 8000:8000 in-memory-search-engine

Using Docker Compose

  1. Start the services:

    docker-compose up --build
  2. Stop the services:

    docker-compose down

Testing

Run the tests using pytest:

pytest --maxfail=1 --disable-warnings -v

For more details on test execution and coverage, refer to the Testing Guide.

Screenshot of Makefile and pytest results

Deployment

Refer to the Deployment Guide for detailed deployment instructions.

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

Documentation

License

This project is licensed under the MIT License. See the LICENSE file for details.

Additional Resources