infinilabs / analysis-ik

🚌 The IK Analysis plugin integrates Lucene IK analyzer into Elasticsearch and OpenSearch, support customized dictionary.
Apache License 2.0
16.48k stars 3.27k forks source link

Add new analyzer for speed match_phrase query #1054

Open muhao1020 opened 4 months ago

muhao1020 commented 4 months ago

medcl 你好,对于ES 的text 类型字段主要使用方式有match 和 match_phrase 两种,前者仅仅是匹配查询,后者则需要命中 terms 之间的相对 position也要和query 的中的terms 的相对位置一样。对于细粒度分词,如果有标准确定这些分词的position就可以在细粒度分词字段上使用match_phrase 。 为此新加了两个分词器,他们分别是通过首字和尾字的position确定本分词结果的 position ; 分词结果对match query 无影响,经测试在match_phrase query 上比使用 standard 分词查询时间能下降 95% 以上。

medcl commented 4 months ago

分词这块可以提供一些单元测试的补充么?