Sphinx with metaphone and wildcard search

送分小仙女□ 提交于 2019-12-06 12:52:17

Well you can enable both metaphone and min_prefix_len on an index at once. It will sort of work.

falange* 

might then just work. (to match phalanges)

The problem is the 'stripped' letters may change the 'sound' of the word (because change the pronunciation)

eg falange becomes FLNJ, but falang acully becomes FLNK - so they no longer 'substrings' of one another. (ie phalanges becomes FLNJS, which FLNK* wont match)


... to be honest I dont know a good solution. You could perhaps get better results, if was to apply stemming, BEFORE metaphone. (so the endings that change the pronouncation of the words are removed.

Alas Sphinx can't do this. If you enable stemming and metaphone together, only ONE of the processors will ever fire.


Two possible solutions, implement stemming outside of sphinx (or maybe with regexp_filter. Not sure if say a porter stemmer can be implemnented purely with regular expressions)

or modify sphinx, so that ALL morphology processors apply. (rather than just the first one that changes the word)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!