dongzhan7909 2016-01-26 21:14
浏览 79

狮身人面像搜索不懂特殊字符(重音符号)

I have a MySQL db in utf8_general_ci.

And my sphinx.conf is like this:

source jobs
{
    type                = mysql
    sql_sock            = /var/run/mysqld/mysqld.sock
    sql_query_pre       = SET NAMES utf8
    ...
}

When I query "système" I would like sphinx to search for "système" & "systeme" in the DB.

AND when I query "systeme" I would like sphinx to search for "système" & "systeme" too.

What it does now is removing all the characters before the accents (including the accents themselves). So "système" becomes "me" and "dév" becomes "v"...

PS : I'm using the sphinxapi.php - which shouldn't be preferred over SphinxQL, I know, but it should still work with the api. And I use EXTENDED match mode.

  • 写回答

1条回答 默认 最新

  • dongzhenjian5195 2016-01-27 11:09
    关注

    You need to setup your charset_table to be able do this

    http://sphinxsearch.com/docs/current.html#charsets

    Alas there is no 'magic' config option to just magically work with all languages text, need to setup charset_table to deal with the langauge(s) you deal with.

    Although this is pretty close: http://sphinxsearch.com/forum/view.html?id=9312 (ie steals the hard work MySQL had done with collations and mimics it in charset_table)

    评论

报告相同问题?

悬赏问题

  • ¥15 用lstm来预测股票价格
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上