易于使用的开源快速搜索数据库
Manticore Search 是一款易于使用、开源且快速的数据库,专为搜索而设计。它是 Elasticsearch 的绝佳替代方案。
网站 • 下载 • 文档 • 博客 • 课程 • 论坛 • Slack • Telegram (En) • Telegram (Ru) • Twitter • 用户反馈
简介
Manticore 与其他解决方案的区别在于:
- 它速度极快,因此比替代方案更具成本效益。在当前的可复现基准测试中,Manticore Search 27.1.5 的表现如下:
- 对于 110 万条 Hacker News 评论,比 MySQL 9.7.1](https://db-benchmarks.com/?cache=fast_avg&engines=manticoresearch_27.1.5%2Cmysql_9.7.1&tests=hn_small&memory=110000)[**快 340 倍**],比 Typesense 27.1](https://db-benchmarks.com/?cache=fast_avg&engines=manticoresearch_27.1.5%2Ctypesense_27.1&tests=hn_small&memory=110000)[**快 6.51 倍**]
- 对于1 亿条以上 Hacker News 评论,比经过调优的 Elasticsearch 9.4.3 快 3.85 倍
- 对于 1000 万条 Nginx 日志中选取的典型 DevOps 查询,比经过调优的 Elasticsearch 9.4.3](https://db-benchmarks.com/?cache=fast_avg&engines=elasticsearch_tuned_9.4.3%2Cmanticoresearch_columnar_27.1.5&tests=logs10m&memory=110000&queries=0%2C1%2C3%2C4%2C10%2C11)[**快 5.03 倍**];在仪表板默认的 1000 万条日志查询选择中,比 ClickHouse 26.6.1.1193](https://db-benchmarks.com/?cache=fast_avg&engines=manticoresearch_columnar_27.1.5%2Cclickhouse_26.6.1.1193&tests=logs10m&memory=110000)[**快 1.71 倍**]
- 对于 17 亿条纽约出租车行程数据,比经过调优的 Elasticsearch 9.4.3](https://db-benchmarks.com/?cache=fast_avg&engines=manticoresearch_columnar_27.1.5%2Celasticsearch_tuned_9.4.3&tests=taxi&memory=110000)[**快 2.02 倍**],比 ClickHouse 26.6.1.1193](https://db-benchmarks.com/?cache=fast_avg&engines=manticoresearch_columnar_27.1.5%2Cclickhouse_26.6.1.1193&tests=taxi&memory=110000)[**快 3.16 倍**]
- 对于相同的1000 万条 Nginx 日志摄取,Manticore Search Columnar 27.1.5 在 5 分 46 秒内完成,而经过调优的 Elasticsearch 9.4.3 需要 10 分 15 秒,平均使用 1.02 个 CPU 核心 对比 3.80 个 CPU 核心,平均使用 3.98 GB 内存 对比 36.98 GB 内存,以及 读取 0.41 MB / 写入 8.05 GB 对比 读取 322.14 MB / 写入 18.47 GB。
结果因工作负载而异;请使用链接的仪表板选择与您的工作负载匹配的查询。
-
⚡ 多线程查询执行 和高效的查询并行化利用所有 CPU 核心以实现低响应时间。
-
🔎 全文搜索 在小数据集和大数据集上都能无缝工作。
-
🧩 混合搜索 在单个查询中结合全文检索和向量检索,以获得更好的相关性。
-
💬 对话式搜索 让现有的向量化表通过 SQL
CALL CHAT或 HTTP JSON/search端点,利用 KNN 检索、对话历史和 LLM 支持的响应来回答问题。 -
🏎️ 行式存储 为小型、中型和大型数据集提供快速性能。
-
🗄️ 列式存储,由 Manticore Columnar Library 提供支持,处理大到无法放入 RAM 的数据集。
-
📇 自动二级索引 使用 PGM-index(分段几何模型索引)在索引键和内存位置之间进行高效映射。
-
🧠 基于成本的查询优化 使用索引数据统计信息来选择高效的执行计划。
-
🧮 SQL 优先且兼容 MySQL:使用 SQL 作为原生语法,配合您首选的 MySQL 客户端。
-
🔌 PHP、Python、Python asyncio、JavaScript、Typescript、Java、Elixir、Go 和 Rust 的官方客户端使集成变得容易。
-
🌐 HTTP JSON API 和兼容 Elasticsearch 的写入 支持灵活的数据和模式管理。
-
🧱 分片表 透明地将读写操作分布到单个节点上的物理分片或跨复制集群。
-
🔐 内置身份验证和授权 使用用户、Bearer 令牌和细粒度权限来保护 MySQL、HTTP/HTTPS、分布式远程代理以及与复制相关的操作。
-
🪶 C++ 性能和小巧的占用空间:Manticore Search 启动迅速,空实例的 RSS 占用约为 40MB。
-
⚡ 实时插入 使新添加或更新的文档立即可访问。
-
🎓 play.manticoresearch.com 上的互动课程 让学习更轻松。
-
🔄 准同步多主复制 使用 Galera 并包含负载均衡。
-
🔗 数据同步 支持 MySQL、PostgreSQL、ODBC、XML 和 CSV 等数据源。
-
🛡️ 安全写入:虽然不完全符合 ACID 规范,但 Manticore 支持隔离事务和二进制日志记录。
-
💾 备份和恢复 包括
manticore-backup、SQLBACKUP以及 S3 兼容的备份/恢复支持。
Craigslist、Socialgist、PubChem、Rozetka 以及许多其他平台使用 Manticore 进行高效搜索和流过滤。
更多功能
- 全文搜索与相关性:
- 超过 20 个 全文运算符 和超过 20 个排名因素
- 自定义排名
- 其他搜索功能:
- 自然语言处理 (NLP):
- 流过滤:
- 高可用性:
- 安全性:
- 数据安全:
- 数据存储:
- 行式 - 需要更多 RAM,提供更快的性能
- 列式 - 需要更少的 RAM,仍能提供不错的性能,但对于某些类型的查询,性能低于行式存储
- docstore - 完全不需要 RAM,但仅允许获取原始值,不支持排序/分组/过滤
- 性能优化:
- 二级索引
- 基于成本的优化器确定搜索查询的最高效执行计划
- 数据类型:
- 全文字段 - 倒排索引
- UUID 文档 ID 用于实时表
- 行式和列式存储的 int、bigint 和 float 数值字段
- 多值属性(数组)
- 字符串和 JSON
- 磁盘上的 "stored" 用于键值用途
- 集成:
安装
快速安装
对于使用 Homebrew 的 Linux 和 macOS,请使用单行安装器:
curl https://manticoresearch.com | sh
它检测 Debian/Ubuntu/Mint、类 RHEL/CentOS/Amazon/Oracle/Fedora 的 RPM 系统,以及带有 Homebrew 的 macOS。在需要时配置官方 Manticore 仓库,安装 manticore,在支持时启动服务,并打印结果。
常用命令:
curl https://manticoresearch.com | sh -s help
curl https://manticoresearch.com | sh -s list-versions
curl https://manticoresearch.com | sh -s version 25.0.0
curl https://manticoresearch.com | sh -s dev
curl https://manticoresearch.com | sh -s upgrade
Docker
Docker 镜像可在 Docker Hub 上获取。
要在 Docker 中试用 Manticore Search,只需运行:
docker run --name manticore --rm -d manticoresearch/manticore && until docker logs manticore 2>&1 | grep -q "accepting connections"; do sleep 1; done && docker exec -it manticore mysql && docker stop manticore
然后你可以:创建表、添加数据并运行搜索。例如:
create table movies(title text, year int) morphology='stem_en' html_strip='1' stopwords='en';
insert into movies(title, year) values ('The Seven Samurai', 1954), ('Bonnie and Clyde', 1954), ('Reservoir Dogs', 1992), ('Airplane!', 1980), ('Raging Bull', 1980), ('Groundhog Day', 1993), ('<a href="http://google.com/">Jurassic Park</a>', 1993), ('Ferris Bueller\'s Day Off', 1986);
select highlight(), year from movies where match('the dog');
select highlight(), year from movies where match('days') facet year;
select * from movies where match('google');
请注意,退出 MySQL 客户端后,Manticore 容器将被停止并移除,导致没有保存的数据,因此仅将此方式用于测试/沙箱目的。
阅读 docker 镜像的完整说明] 以获取更多详细信息,包括我们在生产环境中运行的建议。
手动安装包
如果您更喜欢显式的包管理器命令,请使用以下手动说明或查看 下载页面]。
适用于 RHEL/CentOS/Amazon/Oracle/Fedora 类 Linux 的 RPM 仓库
sudo yum install https://repo.manticoresearch.com/manticore-repo.noarch.rpm
sudo yum install manticore
或在可用时使用 dnf:
sudo dnf install https://repo.manticoresearch.com/manticore-repo.noarch.rpm
sudo dnf install manticore
Ubuntu/Debian/Mint 的 APT 仓库
wget https://repo.manticoresearch.com/manticore-repo.noarch.deb
sudo apt install ./manticore-repo.noarch.deb
sudo apt update
sudo apt install manticore
macOS 上的 Homebrew
brew install manticoresoftware/tap/manticoresearch manticoresoftware/tap/manticore-extra
Windows
对于 WSL/WSL2,请在 WSL 发行版内使用 Linux 安装程序。对于原生 Windows,请参阅 Windows 安装说明。
文档和社区站点
第三方集成
- https://dev.tiki.org/Manticore-Search - TikiWiki CMS Groupware 集成
- https://github.com/EvilFreelancer/laravel-manticoresearch - Laravel ManticoreSearch 插件
- https://www.mediawiki.org/wiki/Extension:SphinxSearch - MediaWiki 扩展
- https://github.com/gordonbanderson/silverstripe-manticore-search - SilverStripe 集成
- https://drwho.virtadpt.net/archive/2022-05-13/combining-manticore-and-searx/ - SearX 集成
- https://github.com/dimv36/sphinxlink - 用于执行搜索查询并返回 PostgreSQL 表数据的 PostgreSQL 扩展
我们如何支持您
如果您的公司需要任何帮助——我们提供全周期服务:
- 审计
- 支持
- 咨询
- 开发
- 培训
❤️ 如何支持 Manticore Search
Manticore Search 是一个开源项目,其开发得益于核心团队、贡献者和赞助者的支持。构建优质的开源软件并不容易。如果您希望确保 Manticore Search 保持免费,以下是您可以支持该项目的方式:
许可证
Manticore Search 依据 GPLv3 或更高版本 分发。Manticore Search 使用并重新分发了其他开源组件。请查看 组件许可证 目录以获取详细信息。