Manticore Search:快速、高效的 Elasticsearch 开源替代方案。
Manticore Search: Fast, efficient, drop-in replacement for Elasticsearch

原始链接: https://github.com/manticoresoftware/manticoresearch

## Manticore Search:快速且经济高效的搜索引擎数据库 Manticore Search 是一款强大的开源数据库,专为快速高效的全文搜索而设计,是 Elasticsearch 的有力替代方案。它凭借多线程和查询并行化充分利用 CPU 核心,在速度和成本效益方面表现出色。 Manticore 支持多种数据存储选项(行式、列式和 docstore),以适应不同数据集的大小和性能需求。它使用基于成本的查询优化器,并自动创建高性能的二级索引(PGM-index)以获得快速结果。 值得注意的是,Manticore 采用 SQL 优先的策略,与 MySQL 协议兼容,并提供多种语言的客户端(PHP、Python、Java 等)。它具有实时插入、内置复制和负载均衡功能,以及从 MySQL 和 PostgreSQL 等数据源同步数据的功能。虽然并非完全 ACID 兼容,但它提供隔离的事务和备份。 像 Craigslist 和 PubChem 这样的公司都在使用 Manticore,它可以通过 Docker 轻松部署,并提供全面的文档、交互式课程以及专业的支持和开发服务。

## Manticore Search:快速的 Elasticsearch 替代方案 Manticore Search 被定位为 Elasticsearch 的高性能、开源替代方案,侧重于速度、简洁性以及避免厂商锁定。虽然它支持部分 Elasticsearch API,但开发者明确指出它*不是*一个可以直接替换的方案,尤其是在复杂用例中。它使用自己的基于 SQL 的查询语言和 REST 端点。 讨论强调了 Manticore 在全文和向量搜索方面的优势,以及更低的资源开销和 SQL 功能。然而,一些用户质疑它是否适合日志索引,认为 Loki 或 QuickWit 等专用工具更合适。 与 Typesense 和 Meilisearch 等竞争对手的主要区别包括更底层的分词控制和 SQL 优先的方法。虽然自动分片和动态映射等功能目前缺失,但正在开发中。基准测试显示出令人鼓舞的性能提升,这归功于架构优化和高效的资源利用。团队欢迎对用例、必要的 Elasticsearch 功能和性能比较的反馈。
相关文章

原文

Manticore Search Logo

Easy to use open source fast database for search

Manticore Search is an easy-to-use, open-source, and fast database designed for search. It is a great alternative to Elasticsearch.

License: GPLv3 or later GitHub Actions Workflow Status Twitter Follow Slack Docker pulls Newsletter Activity GitHub closed issues

❗Read recent blog post about Manticore vs Elasticsearch

What distinguishes it from other solutions is:

  • It's very fast and therefore more cost-efficient than alternatives, for example Manticore is:
  • With its modern multithreading architecture and efficient query parallelization capabilities, Manticore is able to fully utilize all your CPU cores to achieve the quickest response times possible.
  • The powerful and speedy full-text search works seamlessly with both small and large datasets.
  • Row-wise storage for small, medium and big size datasets.
  • For even larger datasets, Manticore offers columnar storage support through the Manticore Columnar Library, capable of handling datasets too big to fit in RAM.
  • Performant secondary indexes are automatically created using the PGM-index (Piecewise Geometric Model index), which provides efficient mapping between indexed keys and their memory locations.
  • The cost-based query optimizer uses statistical data about indexed data to evaluate and determine the most efficient execution plan.
  • Manticore is SQL-first, utilizing SQL as its native syntax, and offers compatibility with the MySQL protocol, allowing you to use your preferred MySQL client.
  • With clients available in PHP, Python, Python asyncio JavaScript, Typescript, Java, Elixir, Go, and Rust, integration with Manticore Search becomes easy.
  • Manticore also provides a programmatic HTTP JSON protocol for more versatile data and schema management, with Elasticsearch-compatible writes support.
  • Built in C++, Manticore Search starts quickly and uses minimal RAM (around 40MB RSS for an empty instance), with low-level optimizations contributing to its impressive performance.
  • With real-time inserts, newly added or updated documents are immediately accessible.
  • Interactive courses are available through Interactive courses to make learning a breeze.
  • Manticore also boasts built-in virtually synchronous multi-master replication using the Galera library and load balancing capabilities.
  • Data can be synced from sources such as MySQL, PostgreSQL, ODBC, xml, and csv with ease.
  • While not fully ACID-compliant, Manticore supports isolated transactions and binary logging for safe writes.
  • Effortless data backup and recovery with built-in tools like manticore-backup and SQL BACKUP command

Craigslist, Socialgist, PubChem, Rozetka and many others use Manticore for efficient searching and stream filtering.

Manticore Search was forked from Sphinx 2.3.2 in 2017.

  • Full-text search and relevance:
  • Other search capabilities:
  • Natural language processing (NLP):
  • Stream filtering:
  • High-availability:
  • Security:
  • Data safety:
  • Data storages:
    • row-wise - requires more RAM, provides faster performance
    • columnar - requires less RAM, still provides decent performance, but lower than the row-wise storage for some kinds of queries
    • docstore - doesn't require RAM at all, but allows only fetching original value, not sorting/grouping/filtering
  • Performance optimizations:
    • Secondary indexes
    • Cost-based optimizer determines the most efficient execution plan of a search query
  • Data types:
    • full-text field - inverted index
    • int, bigint and float numeric fields in row-wise and columnar fashion
    • multi-value attributes (array)
    • string and JSON
    • on-disk "stored" for key-value purpose
  • Integrations:

Docker image is available on Docker Hub.

To experiment with Manticore Search in Docker just run:

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

You can then: create a table, add data and run searches. For example:

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');

Note that upon exiting the MySQL client, the Manticore container will be stopped and removed, resulting in no saved data, so use this way only for testing / sandboxing purposes.

Read the full instruction for the docker image for more details including our recommendations on running it in production.

YUM repo for RHEL/Centos/Amazon/Oracle Linux

sudo yum install https://repo.manticoresearch.com/manticore-repo.noarch.rpm
sudo yum install manticore manticore-extra

APT repo for Ubuntu/Debian/Mint

wget https://repo.manticoresearch.com/manticore-repo.noarch.deb
sudo dpkg -i manticore-repo.noarch.deb
sudo apt update
sudo apt install manticore manticore-extra
brew install manticoresoftware/tap/manticoresearch manticoresoftware/tap/manticore-extra

See instruction here.

Should your company require any help - we provide full-cycle services in the areas of Sphinx and Manticore Search:

  • Audit
  • Support
  • Consulting
  • Development
  • Training

More details here

Manticore Search is an Open Source project with development made possible by support from our core team, contributors, and sponsors. Building premium Open Source software is not easy. If you would like to make sure Manticore Search stays free, here is how you can help the project:

Manticore Search is distributed under GPLv3 or later. Manticore Search uses and re-distributes other open-source components. Please check the component licenses directory for details.

联系我们 contact @ memedata.com