{"id":40851128,"url":"https://github.com/bernabedev/bunisearch","last_synced_at":"2026-01-21T23:37:56.401Z","repository":{"id":308752023,"uuid":"1033481498","full_name":"bernabedev/bunisearch","owner":"bernabedev","description":"A high-performance, multi-collection, full-text search engine built with Bun.","archived":false,"fork":false,"pushed_at":"2025-08-07T16:45:11.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-07T18:26:54.673Z","etag":null,"topics":["bun","bunisearch","search","search-engine"],"latest_commit_sha":null,"homepage":"https://github.com/bernabedev/bunisearch#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bernabedev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-06T22:10:26.000Z","updated_at":"2025-08-07T16:45:15.000Z","dependencies_parsed_at":"2025-08-07T18:43:41.807Z","dependency_job_id":null,"html_url":"https://github.com/bernabedev/bunisearch","commit_stats":null,"previous_names":["bernabedev/bunisearch"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bernabedev/bunisearch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernabedev%2Fbunisearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernabedev%2Fbunisearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernabedev%2Fbunisearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernabedev%2Fbunisearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bernabedev","download_url":"https://codeload.github.com/bernabedev/bunisearch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernabedev%2Fbunisearch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28646950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","bunisearch","search","search-engine"],"created_at":"2026-01-21T23:37:55.675Z","updated_at":"2026-01-21T23:37:56.394Z","avatar_url":"https://github.com/bernabedev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"buni-light.svg\" alt=\"BuniSearch Logo\" width=\"150\"/\u003e\n  \u003ch1\u003eBuniSearch 🐰🔍\u003c/h1\u003e\n  \u003cp\u003e\n    \u003cstrong\u003eA high-performance, multi-collection, full-text search engine built with Bun.\u003c/strong\u003e\n  \u003c/p\u003e\n  \u003cp\u003e\n    Inspired by the speed and developer experience of Typesense and Algolia, BuniSearch is designed from the ground up to be a powerful, self-hostable search solution written entirely in TypeScript and optimized for the Bun runtime.\n  \u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"#-key-features\"\u003e✨ Features\u003c/a\u003e •\n    \u003ca href=\"#-quick-start\"\u003e🚀 Quick Start\u003c/a\u003e •\n    \u003ca href=\"#-api-reference\"\u003e📚 API Reference\u003c/a\u003e •\n    \u003ca href=\"#-running-with-docker\"\u003e🐳 Docker\u003c/a\u003e •\n    \u003ca href=\"#-contributing\"\u003e🤝 Contributing\u003c/a\u003e\n  \u003c/p\u003e\n\n[![Tests](https://img.shields.io/github/actions/workflow/status/bernabedev/bunisearch/test.yml?branch=main\u0026label=tests\u0026style=for-the-badge)](https://github.com/bernabedev/bunisearch/actions)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)\n\n\u003c/div\u003e\n\n---\n\n## ✨ Key Features\n\nBuniSearch isn't just a simple library; it's a full-featured search server with a modern architecture.\n\n- 🚀 **Blazing Fast:** Built on [Bun](https://bun.sh/), leveraging its incredible speed for indexing and searching.\n- 🗂️ **Multi-Collection Architecture:** Manage multiple, independent search indexes (like `products`, `users`, `articles`) on a single server instance, similar to Typesense or Elasticsearch.\n- 🔎 **Advanced Full-Text Search:**\n  - **Typo Tolerance (Fuzzy Search):** Finds results even with typos, powered by Levenshtein distance.\n  - **Relevance Scoring:** Sophisticated TF-IDF ranking to surface the most relevant results first. (Okapi BM25 planned).\n  - **Language Agnostic:** Unicode-aware tokenizer handles multiple languages out of the box.\n- **Powerful Filtering \u0026 Faceting:**\n- **Term, Boolean \u0026 Numeric Filters:** Drill down with `gte`/`lte` range filters and exact keyword matches.\n- **Dynamic Facets:** Get category counts on your search results to build rich, explorable UIs.\n- 💾 **Persistent Storage:** Indexes are automatically saved to disk and loaded on startup, ensuring your data survives restarts.\n- 🐳 **Docker Ready:** Comes with a `Dockerfile` for easy, isolated deployment in any environment.\n- 📚 **Self-Documenting API:** The built-in REST API, powered by [bklar](https://github.com/bernabedev/bklar), includes automatic Swagger \u0026 Scalar UI documentation.\n\n## 🚀 Quick Start\n\nGet a BuniSearch server running in under 2 minutes.\n\n### 1. Running with Docker (Recommended)\n\nThis is the easiest way to get started.\n\n```bash\n# 1. Clone the repository\ngit clone https://github.com/bernabedev/bunisearch.git\ncd bunisearch\n\n# 2. Build the Docker image\ndocker build -t bunisearch .\n\n# 3. Run the container\n# This command maps port 3000 and mounts a local `./data` directory\n# for persistent storage.\ndocker run -d -p 3000:3000 -v $(pwd)/data:/app/data --name my-bunisearch-instance bunisearch\n```\n\nYour BuniSearch API is now running and accessible at `http://localhost:3000`.\n\n### 2. Running Locally with Bun\n\nYou need [Bun](https://bun.sh/docs/installation) installed.\n\n```bash\n# 1. Clone the repository\ngit clone https://github.com/bernabedev/bunisearch.git\ncd bunisearch\n\n# 2. Install dependencies\nbun install\n\n# 3. Start the API server\nbun run api.ts\n```\n\nYour BuniSearch API is now running at `http://localhost:3000`.\n\n## 📚 API Reference\n\nOnce the server is running, you can interact with it via its REST API. For a full, interactive experience, visit the auto-generated documentation:\n\n- **Swagger UI:** `http://localhost:3000/docs/swagger`\n- **Scalar UI:** `http://localhost:3000/docs/scalar`\n\nHere are уничтожитель most common operations:\n\n### 1. Create a Collection\n\nFirst, define the structure of your data.\n\n**`POST /collections`**\n\n```json\n{\n  \"name\": \"products\",\n  \"schema\": {\n    \"title\": { \"type\": \"string\" },\n    \"brand\": { \"type\": \"string\", \"facetable\": true },\n    \"price\": { \"type\": \"number\", \"sortable\": true },\n    \"rating\": { \"type\": \"number\", \"sortable\": true }\n  }\n}\n```\n\n### 2. Add (Index) a Document\n\nAdd documents to your new collection. You can provide your own ID as a query parameter.\n\n**`POST /collections/products/docs?id=product-123`**\n\n```json\n{\n  \"title\": \"High-Performance Laptop\",\n  \"brand\": \"TechCorp\",\n  \"price\": 1499.99,\n  \"rating\": 4.8\n}\n```\n\n### 3. Search\n\nPerform a powerful search query.\n\n**`POST /collections/products/search`**\n\n```json\n{\n  \"q\": \"higt-performanc laptop\",\n  \"tolerance\": 2,\n  \"limit\": 5,\n  \"filters\": {\n    \"price\": { \"lte\": 2000 },\n    \"rating\": { \"gte\": 4.5 }\n  },\n  \"facets\": [\"brand\"]\n}\n```\n\n**Example Response:**\n\n```json\n{\n  \"hits\": [\n    {\n      \"id\": \"product-123\",\n      \"score\": 1.875,\n      \"document\": {\n        \"title\": \"High-Performance Laptop\",\n        \"brand\": \"TechCorp\",\n        \"price\": 1499.99,\n        \"rating\": 4.8,\n        \"id\": \"product-123\"\n      }\n    }\n  ],\n  \"count\": 1,\n  \"facets\": {\n    \"brand\": {\n      \"TechCorp\": 1\n    }\n  },\n  \"elapsed\": \"5ms\"\n}\n```\n\n### Other Endpoints\n\n- `GET /health`: Check if the server is running.\n- `GET /stats`: Get memory usage and index statistics.\n- `GET /collections`: List all collection names.\n- `DELETE /collections/:collectionName`: Delete a collection.\n- `GET /collections/:collectionName/docs/:docId`: Retrieve a document.\n- `PUT /collections/:collectionName/docs/:docId`: Update a document.\n- `DELETE /collections/:collectionName/docs/:docId`: Delete a document.\n\n## 🧪 Running Tests\n\nTo ensure reliability, BuniSearch comes with a comprehensive test suite.\n\n```bash\n# Run all tests\nbun test\n```\n\n## 🗺️ Project Roadmap\n\nBuniSearch is an active project. Here's what's planned for the future:\n\n- [x] **Okapi BM25 Ranking:** Implement a more advanced relevance scoring algorithm.\n- [x] **Trie-based Fuzzy Search:** Drastically improve fuzzy search performance.\n- [x] **Phrase \u0026 Proximity Search:** Support for searching exact phrases like `\"red laptop\"`.\n- [ ] **Asynchronous API:** Convert core operations to be fully non-blocking.\n- [x] **FFI Optimizations:** Rewrite performance-critical sections (like Levenshtein) in Rust or Zig for native speed.\n- [ ] **Official Client Libraries:** Provide official client libraries for JavaScript/TypeScript.\n\n## 🤝 Contributing\n\nContributions are highly welcome! Whether it's a bug report, a feature request, or a pull request, your input is valued.\n\n1.  **Fork the repository.**\n2.  **Create a new branch:** `git checkout -b feature/my-awesome-feature`\n3.  **Make your changes.**\n4.  **Add tests for your changes.**\n5.  **Run the test suite:** `bun test`\n6.  **Submit a pull request.**\n\nPlease open an [issue](https://github.com/bernabedev/bunisearch/issues) to discuss significant changes before starting work.\n\n## 📄 License\n\nThis project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernabedev%2Fbunisearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbernabedev%2Fbunisearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernabedev%2Fbunisearch/lists"}