- Create a virtual environment and activate it by running:
python3 -m venv .venv
source .venv/bin/activate- Install packages
uv syncThis project uses Elasticsearch through Docker Compose to facilitate document indexing and searching.
- Docker and Docker Compose installed on your system
- Curl (optional, to verify Elasticsearch status)
To start the Elasticsearch service, run the following command from the project root:
docker-compose up -dThe -d parameter runs the containers in the background.
To check that Elasticsearch is working properly:
curl http://localhost:9200You should receive a JSON response with information about the Elasticsearch instance.
To stop the services:
docker-compose downIf you also want to remove the volumes (this will delete all indexed data):
docker-compose down -vOnce Elasticsearch is running, you can run the indexing script:
python index_docs.pyTo search for documents, run the following command:
python search_docs.py "Apple total net sales" --top-k 3