{"slug": "show-hn-hlquery-an-open-source-c-20-search-engine", "title": "Show HN: hlquery, An open-source C++20 search engine", "summary": "Hlquery, an open-source C++20 search engine, is now available on GitHub under an unstable branch, offering full-text search, hybrid ranking, vector similarity, and AI-assisted search via a REST API and command-line tools. The project is in active development and not recommended for production use, with a live demo at demo.hlquery.com. It targets teams needing lightweight, efficient search with low operational overhead.", "body_md": "Development Status: hlquery is currently in active development and should not be used in production environments. The software may contain bugs and incomplete features, and breaking changes may occur without notice.\n\nYou can explore the live demo at\n\n[demo.hlquery.com]. It runs on the[m_demo.cpp]module, which disables insert, delete, and update operations in demo mode. The demo UI is built with[hanalyzer].\n\nhlquery is an open-source C++ search engine built to stay lightweight while handling millions of results efficiently. It targets applications that need fast indexing, real-time queries, and a straightforward HTTP/JSON interface with advanced search features. The engine supports full-text search, hybrid ranking, vector similarity, flexible collections, and configurable runtime modules for features such as AI-assisted search. It also includes a REST API for indexing and querying, plus command-line tools for local management and testing.\n\nhlquery is built for teams that want strong search without the operational weight of a larger stack. It combines fast indexing, low-latency queries, and a simple HTTP/JSON API with features usually found in more complex systems.\n\nYou can use hlquery for full-text search, hybrid retrieval, vector similarity, and AI-assisted workflows while keeping deployment straightforward. It ships with client libraries, command-line tools, and modular runtime extensions for local development and production services.\n\nhlquery organizes data into **collections**. A collection is a logical group of related records, such as products, articles, users, or events, and its schema defines the fields that can be indexed, searched, filtered, sorted, or used for faceting.\n\nEach collection contains **documents**. A document is a JSON record identified by a unique ID and made up of fields such as `title`\n\n, `content`\n\n, `category`\n\n, or `price`\n\n. Documents in the same collection follow the same general schema, while each document stores its own values.\n\nFor example, a `products`\n\ncollection can contain one document per product. You can then search the text fields, filter by structured fields such as category or price, and return only the fields needed by your application. Collections keep different types of data organized while allowing each type to have its own schema and search behavior.\n\n**Debian/Ubuntu:**\n\n``` bash\n$ sudo apt-get install build-essential cmake zlib1g-dev libssl-dev liburing-dev\n```\n\n`cmake`\n\nand `zlib1g-dev`\n\nare required to configure and build hlquery and its\nbundled RocksDB dependency on Debian/Ubuntu.\nThe `./configure`\n\nscript validates CMake, GNU Make, the C++ compiler, and zlib\nheaders/linking, and exits with an installation hint when a requirement is missing.\n\nIf CMake prints a `uring`\n\nlookup warning during the rocksdb build, it usually means the `liburing`\n\ndevelopment package is missing. Installing `liburing-dev`\n\non Debian/Ubuntu provides the package metadata CMake is looking for and clears the warning.\n\n**Red Hat/CentOS:**\n\n``` bash\n$ sudo dnf install @development-tools cmake openssl-devel\n```\n\n**macOS:**\n\n``` bash\n$ xcode-select --install\n$ brew install cmake openssl\n```\n\nOn macOS, Xcode Command Line Tools provide the C/C++ compiler and `make`\n\n.\nHomebrew provides CMake and OpenSSL.\n\n**FreeBSD:**\n\n``` bash\n$ sudo pkg install gmake cmake openssl\n```\n\n**Note**: This project uses gmake features. On FreeBSD, run `gmake`\n\ninstead of `make`\n\n.\n\n``` bash\n$ wget https://github.com/hlquery/hlquery/archive/refs/heads/unstable.zip\n$ cd hlquery/\n$ ./configure\n```\n\nOn GNU/Linux:\n\n``` bash\n$ make -j4\n$ make install\n```\n\nOn FreeBSD, use GNU make for the build and install steps:\n\n``` bash\n$ gmake -j4\n$ gmake install\n```\n\n**Start the server**\n\n```\n$ ./run/hlquery start\n[ OK ] Starting hlquery: [Jul-12 - 12:37:59]\n...\n```\n\nNote: hlquery uses port9200by default. Ensure this port is available and not blocked by your firewall.\n\n**Stop the server**\n\n```\n$ ./run/hlquery stop\n[ INFO ] Stopping hlquery (PID: 27008) ...\n[ OK ] hlquery stopped successfully.\n```\n\n**Stop the server as JSON**\n\n```\n$ ./run/hlquery stop --json\n{\"action\":\"stop\",\"stopped_pid\":206773,\"success\":true}\n```\n\n**Run in foreground (for debugging):**\n\n```\n$ ./run/hlquery start --nofork\n...\n```\n\n**Run the interactive shell**\n\n```\n$ ./run/hlquery talk\nlocalhost:9200> use art\nUsing collection 'art'.\n```\n\n**Checking uptime's**\n\n```\nlocalhost:9200|art> uptime\nServer up for 3 days, 1h 0m 31s\n```\n\nOfficial client libraries are available for popular programming languages:\n\n| Client | Description |\n|---|---|\n|\nNative C++ client library for low-level and embedded integrations. |\n|\nGo client for indexing, search, and service backends. |\n|\nJVM client for Java applications and server-side integrations. |\n|\nAsync JavaScript client for Node.js services and tools. |\n|\nPerl client library for scripts and existing Perl services. |\n|\nComposer-ready PHP client for web apps and API integrations. |\n|\nPython client for scripts, data workflows, and backend services. |\n|\nRuby client for Rails apps, scripts, and service integrations. |\n|\nRust client library for strongly typed hlquery integrations. |\n|\nTyped client for TypeScript applications and SDK-style integrations. |\n\nFor complete API documentation, visit [docs.hlquery.com](https://docs.hlquery.com/).\n\n```\n$ ./run/hlquery cli create products title content price\nCollection 'products' created successfully\n```\n\n**Using the PHP API:**\n\n``` php\n<?php\n\nrequire_once __DIR__ . '/vendor/autoload.php';\nuse Hlquery\\Client;\n\n$client = new Client('http://localhost:9200');\n$collections = $client->collections();\n\n$schema = [\n    'fields' => [\n        ['name' => 'title', 'type' => 'string'],\n        ['name' => 'content', 'type' => 'string'],\n        ['name' => 'sku', 'type' => 'keyword'],\n        ['name' => 'price', 'type' => 'float'],\n    ],\n];\n\n$response = $collections->create('products', $schema);\n$body = $response->getBody();\necho json_encode($body, JSON_PRETTY_PRINT) . PHP_EOL;\n\n$client->documents->add('products', [\n    'id' => 'prod_keyboard_001',\n    'title' => 'Wireless Keyboard',\n    'content' => 'Compact Bluetooth keyboard for daily work.',\n    'price' => 49.99,\n]);\n```\n\nEach document ID must be unique within its collection:\n\n``` bash\n$ hlquery-cli add products prod_laptop_001 \"Laptop Computer\" \"High-performance laptop with 16GB RAM\"\nDocument 'prod_laptop_001' added to collection 'products'\n```\n\n**Using the Node API**\n\n``` js\nconst Client = require('hlquery-node-client');\nconst client = new Client('http://localhost:9200');\nconst documents = client.documents(); // Use the documents service for document writes.\n\n/* Send POST /collections/products/documents with the product payload. */\n\nconst response = await documents.add('products', {\n  id: 'prod_laptop_001',\n  title: 'Laptop Computer',\n  content: 'High-performance laptop with 16GB RAM',\n  price: 1299.99\n});\n\n/* Inspect the JSON body returned by the API. */\n\nconsole.log(response.getBody());\nbash\n$ hlquery-cli search products \"laptop\"\nSearch results for 'laptop' in collection 'products':\nFound 1 document(s) (showing 1-1 of 1)\n\n+---+-----------------+----------+-----------------+---------------------------------------+\n| # | Document ID     | Score    | Title           | Content Preview                       |\n+---+-----------------+----------+-----------------+---------------------------------------+\n| 1 | prod_laptop_001 | 1.094500 | Laptop Computer | High-performance laptop with 16GB RAM |\n+---+-----------------+----------+-----------------+---------------------------------------+\n```\n\n**Using the C++ API**\n\n```\n#include \"hlquery/client.h\"\n\nhlquery::Client client(\"http://localhost:9200\");\nauto collections = client.collections();\nauto result = collections->search(\"products\", {{\"like\", \"laptop\"}});\n# Field-specific search\n$ ./run/hlquery cli search products \"title:laptop\"\n\n# Range query\n$ ./run/hlquery cli search products \"price:[100 TO 500]\"\n\n# Fuzzy search (tolerates typos)\n$ ./run/hlquery cli search products \"laptop~2\"\n\n# Wildcard search\n$ ./run/hlquery cli search products \"laptop*\"\n\n# Case-sensitive search\n$ ./run/hlquery cli search products \"is:casesensitive Laptop\"\n\n# Boost term importance\n$ ./run/hlquery cli search products \"laptop^2.0 computer\"\n\n# NOT operator\n$ ./run/hlquery cli search products \"!apple\"\n\n# Combined queries\n$ ./run/hlquery cli search products \"title:laptop AND price:[100 TO 500]\"\n```\n\nhlquery supports linking two or more servers together. Links are configured in `links.conf`\n\nwith `<node ...>`\n\nentries and can be used for distributed queries, write replication, or both by listing the same remote endpoint with the role needed for each purpose.\n\nDistributed search fans a query out to linked search nodes and merges the results. Use `role=\"distributed\"`\n\nfor query peers and enable `<distributed_search ...>`\n\n:\n\n```\n<node\n     host=\"127.0.0.1\"\n     port=\"9201\"\n     role=\"distributed\"\n     passwd=\"shared-secret\">\n\n<distributed_search\n     enabled=\"true\"\n     mode=\"local_first\"\n     prefer_local=\"true\"\n     timeout_ms=\"250\">\n```\n\n**SQL example:**\n\n```\n$ ./run/hlquery talk\nlocalhost:9200> sql: select title from music where content like 'madon%' or content like 'nirva%';\nSQL rows for `select title from music where content like 'madon%' or content like 'nirva%';`:\n+-------------------------+\n| title                   |\n+-------------------------+\n| Artist Profile: Madonna |\n| Artist Profile: Nirvana |\n+-------------------------+\n2 results shown.\nSearch completed in 19 ms.\n```\n\nRuntime links use the same role split. Use `role=\"master\"`\n\n(or `distributed`\n\n) for a query link and `role=\"slave\"`\n\n(or `replica`\n\n) for a replication target. If the link is authenticated, include `token`\n\nand optionally `token2`\n\nin the JSON body; runtime-added links are in-memory and must be added again after restart:\n\n```\nPOST /links/connect\n{\"host\":\"127.0.0.1\",\"port\":9202,\"role\":\"slave\",\"token\":\"shared-secret\"}\n```\n\nhlquery is actively developed across multiple GitHub repositories. We maintain a structured development workflow to ensure stability and continuous improvement.\n\nEach repository follows a **two-branch development model**:\n\n- Active development branch where new features, bug fixes, and improvements are developed`unstable`\n\n- Stable release branch containing production-ready code`1.0`\n\nWe are committed to **active, continuous development** of hlquery and all related projects. New features, performance improvements, and bug fixes are regularly added across all repositories.\n\n**Want to stay updated?** ⭐ **Star and watch our repositories on GitHub** to receive notifications about:\n\n- New releases and features\n- Bug fixes and improvements\n- Documentation updates\n- Community discussions\n\nSubscribe to repository notifications to never miss an update!\n\nWe welcome contributions from the community! All contributions must be released under the BSD 3-Clause license.\n\n- Check existing\n[issues](https://github.com/hlquery/hlquery/issues)or open a new one. - Contribute to client libraries.\n- Test and report bugs.\n- Improve documentation.\n\n- 📖\n[Documentation](https://docs.hlquery.com) - 🐦\n[X (Twitter)](https://x.com/hlquery) - 📦\n[GitHub](https://github.com/hlquery/hlquery)\n\nhlquery is licensed under the [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause).", "url": "https://wpnews.pro/news/show-hn-hlquery-an-open-source-c-20-search-engine", "canonical_source": "https://github.com/hlquery/hlquery", "published_at": "2026-08-22 12:46:30+00:00", "updated_at": "2026-08-22 13:14:44.626217+00:00", "lang": "en", "topics": ["ai-products", "ai-tools", "developer-tools"], "entities": ["hlquery", "GitHub", "RocksDB", "CMake"], "alternates": {"html": "https://wpnews.pro/news/show-hn-hlquery-an-open-source-c-20-search-engine", "markdown": "https://wpnews.pro/news/show-hn-hlquery-an-open-source-c-20-search-engine.md", "text": "https://wpnews.pro/news/show-hn-hlquery-an-open-source-c-20-search-engine.txt", "jsonld": "https://wpnews.pro/news/show-hn-hlquery-an-open-source-c-20-search-engine.jsonld"}}