MeiliSearch 0.18.0 发布了

What’s new in v0.18.0

https://blog.meilisearch.com/v0-18-0/

v0.18.0

In this release, we have fixed some bugs and raised the default payload size when you add documents to MeiliSearch. The star of the show, however, is the new tokenizer. Our main goal is to offer the best search experience, and a good tokenizer is critical to having quality search results. We are very proud of our core team and our contributors—they worked hard, and they delivered! Let’s take a closer look at it.

在这个版本中,我们修复了一些bug,并提高了向MeiliSearch添加文档时的默认payload大小(这样就能批量提交更多的数据了)。
这个版本最核心的功能是发布了新的分词器。我们的主要目标是提供最好的搜索体验,而好的分词器是获得高质量搜索结果的关键。
我们为我们的核心团队和贡献者感到非常自豪——他们努力工作,并且实现了目标!

New Tokenizer

The tokenizer is sort of like the brain of MeiliSearch: it understands how languages work and adapts the way documents are stored in MeiliSearch accordingly. Without a tokenizer, we wouldn’t be able to know where a word starts and where it ends. We wouldn’t be able to understand what a user asks for when performing a search.

分词器有点像“MeiliSearch”的大脑:它了解语言的工作方式,并相应地调整“MeiliSearch”中存储文档的方式。
如果没有分词器,我们就无法知道一个单词从哪里开始和从哪里结束。
我们无法理解用户在执行搜索时的要求。

中文分词

The evolution of MeiliSearch in Chinese
Before, the tokenizer considered one Hanzi character (Chinese character) as one word. The new tokenizer identifies Chinese words made of one or more characters. It assesses the distance between matched query terms more accurately (see: proximity rule) and, as a result, positively improves the relevancy of the search results.

In addition, a single search query will give results in both traditional and simplified Chinese.

中文分词的巨大变化

以前的版本中,分词器把每一个汉字都当作一个词。
新的标记器可以识别由一个或多个字符组成的中文单词。它更准确地评估了匹配的查询词之间的距离(参见:接近规则),并因此积极地提高了搜索结果的相关性。

此外,单个搜索查询将提供繁体和简体中文的结果。

译注

这次版本更新的分词器,用的是 jieba-rs

https://github.com/messense/jieba-rs

没有采用其它包的原因我大约看了一下,要么是觉得过重,要么觉得性能较低。我估计分词器还会再调整,毕竟现在的这种手动提交词库的方法,并不见得有多么高效。

jieba-rs的性能还不错,从自评的测试报告上看,据说会比 cpp 版本还快30%.

https://blog.paulme.ng/posts/2019-06-30-optimizing-jieba-rs-to-be-33percents-faster-than-cppjieba.html

jieba-rs 有哪些问题呢

  1. 内置了一套词库,尚不知道这套词库是从哪里出来的,也不知道质量如何。后续要做的事情便是通过 NLP 和爬虫,定期刷一些大站,从而发现一些新的词汇。再通过人工标注,将热门新词进行提权。
  2. 如果词库进行了修改,jieba-rs (会?)不会热更新词库,这样新入库的文章无法实现动态更新词库进行分词。改的方法比较简单,要么改成异步监听,要么把分词改成服务,在推到 MS 的时候,已经是分词过的文章结构。

目前的想法

  1. 建立一个外部数据存储服务,比如 mongo,将所交的文本json完成保留,方便后期进行预览、重建索引和测试
  2. 建立一个词库管理器,用于保存动态更新的词库和标注数据,并标注同义词,定期更新词库,
  3. 建立一个管理系统,用于管理原始数据量,搜索数据量,增加热加载词库和重建索引的功能

发表评论

评论列表(1)

  • 匿名

    2021.12.12 16:12

    为什么documents我插入不进去数据呢,也没报错

    回复