Local file search application that provides both semantic and lexical search capabilities for your file system using Elasticsearch.
- Documents: PDF, DOC, DOCX, TXT, MD
- Source Code: JS, TS, PY, JAVA, CPP, C, H
- Data: JSON
- Content Extraction: Full-text search within file contents
GET /api/search- Search filesGET /api/files/:id- Get file detailsDELETE /api/files/:id- Remove file from indexPOST /api/index- Index a directoryPOST /api/index/reset- Reset the entire indexPOST /api/watch/start- Start watching directory for changesPOST /api/watch/stop- Stop watching directories
https://github.com/elastic/start-local
curl -fsSL https://elastic.co/start-local | shThis will:
- Download and start Elasticsearch on
http://localhost:9200 - Download and start Kibana on
http://localhost:5601 - Provide you with credentials (username, password, API key)
If you already have Elasticsearch running, just update your .env file with the connection details.
npm installCreate .env file with Elasticsearch credentials from start-local output:
cp env.example .env
# Edit .env with your actual credentialsnpm run check-setupnpm run dev- UI: http://localhost:3000
- API: http://localhost:3000/api
- Health Check: http://localhost:3000/health
-
Index Your Files
- Open the web interface at http://localhost:3000
- Enter a directory path (e.g.,
/Users/yourusername/Documents) - Click "Index Directory" to scan and index all supported files
-
Start Real-time Watching (Optional)
- Use the same directory path
- Click "Start Watching" to automatically index new/modified files
-
Search Your Files
- Enter search queries like:
- "medical documents" (finds health-related files)
- "python scripts" (finds .py files and code references)
- "meeting notes from last week" (semantic search)
- "invoice.pdf" (exact filename search)
- Enter search queries like:
Hybrid Search (Recommended)
- Combines semantic and lexical approaches
- Best overall results for most queries
Semantic Search
- Finds files by meaning and context
- Great for conceptual searches like "financial reports", "vacation photos"
Lexical Search
- Traditional keyword matching
- Best for exact terms and filenames
- File Extensions: Filter by type (e.g.,
.pdf,.doc,.txt) - Date Range: Find files modified within specific timeframes
- Result Limits: Control number of results (10, 20, 50)
# Basic search
curl "http://localhost:3000/api/search?q=medical+documents&type=hybrid"
# Advanced search with filters
curl "http://localhost:3000/api/search?q=python&type=semantic&extensions=.py,.js&limit=10"# Index a directory
curl -X POST http://localhost:3000/api/index \
-H "Content-Type: application/json" \
-d '{"path": "/Users/username/Documents"}'
# Reset index
curl -X POST http://localhost:3000/api/index/reset# Start watching
curl -X POST http://localhost:3000/api/watch/start \
-H "Content-Type: application/json" \
-d '{"path": "/Users/username/Documents"}'
# Stop watching
curl -X POST http://localhost:3000/api/watch/stopELASTICSEARCH_NODE: Elasticsearch URL (default:http://localhost:9200)PORT: Server port (default:3000)NODE_ENV: Environment mode (developmentorproduction)
The application currently indexes these file types:
- Documents:
.pdf,.doc,.docx,.txt,.md - Source Code:
.js,.ts,.py,.java,.cpp,.c,.h - Data:
.json
# Run tests
npm test
# Run with coverage
npm run test:coverageConnection Issues:
# 1. Check Elasticsearch is running
curl http://localhost:9200
# 2. Verify setup
npm run check-setup
# 3. Restart Elasticsearch
curl -fsSL https://elastic.co/start-local | shCommon fixes:
- Use
http://localhost:9200(not https) in.env - Copy exact credentials from start-local output
- Change PORT in
.envif 3000 is in use