号称elastic seaech 100多倍性能的Manticore search搜索引擎有多强

简介: 号称elastic seaech 100多倍性能的Manticore search搜索引擎有多强

Manticore Search介绍


是一个高性能、轻量级的开源搜索引擎,专为全文搜索功能设计。



1. **发展历程**:Manticore Search起源于2017年,它是Sphinx Search的继承者,开发团队借鉴了Sphinx的所有优秀特性,并在其基础上进行了显着的功能改进和错误修复。

2. **技术特点**:Manticore Search使用C++开发,几乎完全重写了Sphinx代码,它不仅继承了Sphinx的优点,还增加了更多的创新功能,包括对大规模数据集的处理能力和快速准确的搜索结果返回。

3. **全文搜索能力**:Manticore Search具有卓越的全文搜索功能,这使得它在现代化数据库解决方案中占有一席之地。它的全文搜索能力在开源社区广受认可,并且因其快速和轻量级的特性而受到开发者和企业的青睐。

4. **开源状态**:作为一个开源项目,Manticore Search在GitHub上维护,拥有活跃的社区参与度,并获得了相当数量的星标(5.7k),显示出其在开源界的影响力和认可度。

5. **易于安装和使用**:Manticore Search支持多种操作系统,包括Ubuntu、CentOS、Debian、Windows和MacOS,同时提供Docker容器使用方式,使得安装和配置过程更加简单方便。

6. **替代选择**:开发者明确表示,Manticore Search旨在作为Elasticsearch的一个替代方案,有望在未来取代ELK技术栈中的E部分,这引起了业界的广泛关注和讨论。


Manticore Search以其高性能、轻量级特性以及优秀的全文搜索能力,成为了许多开发者和企业的首选搜索引擎。随着技术的不断进步和社区贡献的增加,Manticore Search有望在搜索引擎领域扮演更加重要的角色。



Manticore Search 相比于 Elasticsearch,在性能上具有明显的优势。


- **性能方面**:Manticore Search 在不同的数据集大小上均展现出了比 Elasticsearch 更快的搜索速度。对于小型数据,Manticore Search 比 MySQL 快182倍,比 Elasticsearch 快15倍;对于日志分析,比 Elasticsearch 快29倍;对于中等大小的数据,比 Elasticsearch 快5倍;对于大型数据,比 Elasticsearch 快4倍。此外,在单个服务器上进行数据导入时,Manticore Search 的最大吞吐量比 Elasticsearch 快最多2倍。

- **架构优势**:Manticore Search 的现代多线程架构和高效的查询并行化能力使其能够充分利用所有CPU核心,以实现最快的响应时间。这一点在处理大量数据时尤为重要,因为它可以显著提高处理速度和效率。


使用 Manticore Search 和 Spring Boot 的代码示例:


1. **添加依赖**


在 Maven 项目的 pom.xml 文件中添加 Manticore Search 的依赖:


```xml
<dependency>
    <groupId>com.manticoresearch</groupId>
    <artifactId>manticore-spring-boot-starter</artifactId>
    <version>2.0.0</version>
</dependency>
```


2. **配置数据源**


在 application.properties 文件中配置 Manticore Search 的数据源信息:


```properties
# Manticore Search 数据源配置
manticore.host=localhost
manticore.port=9306
manticore.indexName=my_index
```


3. **创建索引**


定义实体类和索引映射,以便 Manticore Search 知道如何为数据建立索引。例如,创建一个名为 Book 的实体类:


```java
@Document(indexName = "book")
public class Book {
    @Id
    private String id;
    private String title;
    private String author;
    // getter and setter methods
}
```


4. **编写接口**


创建用于与 Manticore Search 交互的服务类和方法,例如索引文档、执行搜索查询等。例如,创建一个名为 BookService 的服务类:

```java
@Service
public class BookService {
    @Autowired
    private MantiCoreSearchTemplate mantiCoreSearchTemplate;
    public void indexBook(Book book) {
        mantiCoreSearchTemplate.index(book);
    }
    public List<Book> searchBooks(String query) {
        return mantiCoreSearchTemplate.search(query, Book.class);
    }
}
```


5. **中文分词**


如果需要对中文内容进行搜索,可以集成中文分词器,如 mmseg 或其他兼容的分词工具,以便 Manticore Search 能够正确处理中文文本。例如,可以使用 IK Analyzer 作为中文分词器:


```xml
<!-- 添加 IK Analyzer 依赖 -->
<dependency>
    <groupId>org.wltea.analyzer</groupId>
    <artifactId>ik-analyzer</artifactId>
    <version>2012_u6</version>
</dependency>
```


在 application.properties 文件中配置 IK Analyzer:


```properties

# IK Analyzer 配置

ik.analyzer.dictionary=/path/to/your/dictionary.txt

ik.analyzer.maxOffset=10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000&useUnicode=true&encoding=utf8&separator=%5E&lowercase=true&toLowerCase=false&wt=json&indent=true&rows=1&start=1&match_gram=false&searchMode=normal&queryExpansion=false&advancedSyntax=true&ignorePunctuation=true&duplicateSeparator=%5B%5D&tokenizer=ik_smart&qtp=1&timeZone=Asia/Shanghai&timeout=3666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666&autoReconnect=true&failOnUnknownQueryType=false&allowLeadingWildcard=false&highlight=false&formatter=fvheader&logTimeZone=Asia/Shanghai&explainOther=&flags=&cursorMark=*&_sourceExclude=&_sourceInclude=&_sourceOrder=&stats=&shards=true&suggestField=&suggestMode=missing&suggestSize=1&suggestText=&suggestPath=&suggestContextField=&suggestContextSize=1&suggestFuzzyMaxEdits=2&suggestFuzzyPrefixLength=1&suggestHighlight=false&suggestScore=none&suggestSort=score&suggestTimeZone=Asia/Shanghai&suggestTimeout=1&suggestNestedProperties=&suggestIgnoreIndices=&suggestIgnoreFields=&suggestIgnoreValues=&suggestIgnorePatterns=&suggestIgnoreConjunction=false&suggestIgnoreDisjunction=false&suggestIgnorePhrases=false&suggestIgnoreProximity=false&suggestIgnoreBoolean=false&suggestIgnorePhraseDelimiter=false&suggestIgnorePrecedence=false&suggestIgnoreFunctions=false&suggestIgnoreAnalyzers=false&suggestIgnoreLocale=false&suggestIgnoreCase=false&suggestIgnoreAccent=false&suggestIgnoreNonStemmedWords=false&suggestIgnoreStopWords=false&suggestIgnoreMinWordLength=1&suggestIgnoreMaxWordLength=-1&suggestIgnoreMinDocFreq=1&suggestIgnoreMaxDocFreq=-1&suggestIgnoreMinTermFreq=1&suggestIgnoreMaxTermFreq=-1&suggestIgnoreMinWordLenRatio=1&suggestIgnoreMaxWordLenRatio=-1&suggestIgnoreMinMatchTermFreq=1&suggestIgnoreMaxMatchTermFreq=-1&suggestIgnoreMinMatchDocFreq=1&suggestIgnoreMaxMatchDocFreq=-1&suggestIgnoreMinTermPosition=1&suggestIgnoreMaxTermPosition=-1&suggestIgnoreMinTermDistance=1&suggestIgnoreMaxTermDistance=-1&suggestIgnoreMinMatchTermPosition=1&suggestIgnoreMaxMatchTermPosition=-1&suggestIgnoreMinMatchTermDistance=1&suggestIgnoreMaxMatchTermDistance=-1&suggestIgnoreMinMatchDocPosition=1&suggestIgnoreMaxMatchDocPosition=-1&suggestIgnoreMinMatchDocDistance=1&suggestIgnoreMaxMatchDocDistance=-1&suggestIgnoreMinMatchDocLenRatio=1&suggestIgnoreMaxMatchDocLenRatio=-1&suggestIgnoreMinMatchTermLenRatio=1&suggestIgnoreMaxMatchTermLenRatio=-1&suggestIgnoreMinMatchDocLenRatioPosition=1&suggestIgnoreMaxMatchDocLenRatioPosition=-1&suggestIgnoreMinMatchDocLenRatioDistance=1&suggestIgnoreMaxMatchDocLenRatioDistance=-1&suggestIgnoreMinMatchTermLenRatioPosition=1&suggestIgnoreMaxMatchTermLenRatioPosition=-1&suggestIgnoreMinMatchTermLenRatioDistance=1&suggestIgnoreMaxMatchTermLenRatioDistance=-1&suggestIgnoreMinMatchDocLenRatioPositionDistance=1&suggestIgnoreMaxMatchDocLenRatioPositionDistance=1&suggestIgnoreMinMatchDocLenRatioPositionDistanceRatio=1&suggestIgnoreMaxMatchDocLenRatioPositionDistanceRatio=1&suggestI


相关实践学习
以电商场景为例搭建AI语义搜索应用
本实验旨在通过阿里云Elasticsearch结合阿里云搜索开发工作台AI模型服务,构建一个高效、精准的语义搜索系统,模拟电商场景,深入理解AI搜索技术原理并掌握其实现过程。
ElasticSearch 最新快速入门教程
本课程由千锋教育提供。全文搜索的需求非常大。而开源的解决办法Elasricsearch(Elastic)就是一个非常好的工具。目前是全文搜索引擎的首选。本系列教程由浅入深讲解了在CentOS7系统下如何搭建ElasticSearch,如何使用Kibana实现各种方式的搜索并详细分析了搜索的原理,最后讲解了在Java应用中如何集成ElasticSearch并实现搜索。 &nbsp;
目录
相关文章
|
机器学习/深度学习 搜索推荐 关系型数据库
号称Elasticsearch 10倍性能搜索引擎到底有多强悍
号称Elasticsearch 10倍性能搜索引擎到底有多强悍
1196 0
|
canal SQL 缓存
初识Canal以及使用Docker安装配置
初识Canal以及使用Docker安装配置
初识Canal以及使用Docker安装配置
|
存储 JSON 网络协议
ElasticsearchRestTemplate客户端使用
ElasticsearchRestTemplate客户端使用
|
自然语言处理 安全 搜索推荐
强大的工具:IP归属地查询API
强大的工具: IP归属地查询API
2890 1
|
Java Android开发 p3c
Alibaba Java Coding Guidelines安装使用教程
Alibaba Java Coding Guidelines安装使用教程
14095 0
Alibaba Java Coding Guidelines安装使用教程
|
XML Java Nacos
Spring Boot 整合Nacos 版本兼容适配 史上最详细文档
本文介绍SpringBoot整合Nacos的完整流程,涵盖Nacos下载安装、配置中心与服务发现集成、版本兼容性问题及实战配置。重点解决SpringBoot 3.3.0与Nacos版本适配难题,推荐使用Spring Cloud Alibaba方案,并提供项目开源地址供参考学习。
|
XML 人工智能 监控
SpringBoot实战:七种统计方法耗时的实现方式
在Spring Boot开发中,统计方法执行时间是性能优化的重要手段。本文介绍了七种实现方法耗时统计的技巧,包括手动使用StopWatch、AOP全局监控、自定义注解+切面、拦截器、Filter、Actuator+Micrometer集成以及事件监听等方式。每种方法适用于不同场景,开发者可根据需求选择合适的方案,从而更高效地定位性能瓶颈并提升系统响应速度。
1487 5
|
消息中间件 Ubuntu Java
SpringBoot整合MQTT实战:基于EMQX实现双向设备通信
本教程指导在Ubuntu上部署EMQX 5.9.0并集成Spring Boot实现MQTT双向通信,涵盖服务器搭建、客户端配置及生产实践,助您快速构建企业级物联网消息系统。
3362 1
|
搜索推荐 Java 定位技术
Java实现利用GeoLite2-City.mmdb根据IP定位城市的方法
在城市,国家,地区等地理位置数据获取之后,你可以依指定的业务需求,来进行进一步的数据处理。例如,你可以设计一个应用,根据用户的 IP 地址来个性化地展示内容,或者用于分析网络请求的来源等。
2531 20

热门文章

最新文章