如同磁铁吸引四周的铁粉,热情也能吸引周围的人,改变周围的情况。

拼音插件能不能做到如何下那样

Elasticsearch | 作者 wmj | 发布于2017年03月30日 | 阅读数:4393

左边是输入,右边索引后的terms,我希望所每一组的term都是position都是0,1,2,这样短语搜索就可以使用任何一种组合,例如postion1的可选有[liu,l],position2:[de,d],position3:[hua,h]

* 刘德华,liudehua=>[liu, de, hua]
* ldh =>[l,d,h]
* 刘德h=>[liu,de,h]
* l德华=>[l,de,hua]
* liudh['liu','d','h']
 
左边是输入,右边索引后的terms,我希望所每一组的term都是position都是0,1,2,这样短语搜索就可以使用任何一种组合,例如postion1的可选有[liu,l],position2:[de,d],position3:[hua,h]

* 刘德华,liudehua=>[liu, de, hua]
* ldh =>[l,d,h]
* 刘德h=>[liu,de,h]
* l德华=>[l,de,hua]
* liudh['liu','d','h']

同时,我希望索引的结果如下:

{
  "tokens": [
    {
      "token": "l",
      "start_offset": 0,
      "end_offset": 1,
      "type": "word",
      "position": 0
    },
    {
      "token": "d",
      "start_offset": 1,
      "end_offset": 2,
      "type": "word",
      "position": 1
    },
    {
      "token": "h",
      "start_offset": 2,
      "end_offset": 3,
      "type": "word",
      "position": 2
    },
    {
      "token": "liu",
      "start_offset": 0,
      "end_offset": 1,
      "type": "word",
      "position": 0
    },
    {
      "token": "de",
      "start_offset":1,
      "end_offset": 2,
      "type": "word",
      "position": 1
    },
    {
      "token": "hua",
      "start_offset": 2,
      "end_offset": 3,
      "type": "word",
      "position": 2
    }
]
}
 
已邀请:

medcl - 今晚打老虎。

赞同来自: wmj

已经fix了一部分position的问题了,非中文的也应该很快就可以解决了。
帮忙测测。
https://github.com/medcl/elast ... e3378

medcl - 今晚打老虎。

赞同来自: wmj

Position的问题已经fix了,5.3.2已经支持了,试试去。
https://github.com/medcl/elast ... beb42
 
下载插件; https://github.com/medcl/elast ... 5.3.2

wangjueying - Java攻城狮-ES爱好者

赞同来自:

老司机啥时候在加上区别多音字的功能啊?

要回复问题请先登录注册