searching in a part of word with Sphinx

牧云@^-^@ 提交于 2019-12-11 10:36:22

问题


I need to configure Sphinx to search for parts of word, not whole. It's written on the official site, that I should use directives 'min_infix_len', 'min_prefix_len' and 'enable_star'. Actually, all registered in the config file.

But search in a word part doesn't work. * in the beginning or end of a word is not helping.

source src1
{

  type= mysql
  sql_host= localhost
  sql_user= root
  sql_pass=
  sql_db= ajax
  sql_port= 3306

  sql_query= \
    SELECT id, bookauthor FROM authors
    sql_query_info= SELECT * FROM authors WHERE id=$id
}


index index1
{
  source= src1
  path = /var/data/src1
  morphology =stem_en
  min_word_len = 1
  charset_type = sbcs
  enable_star=1
  min_infix_len =3
  min_prefix_len = 3
}

searchd
{
  listen = 9312
  log = /var/log/searchd.log
  query_log = /var/log/query.log
  pid_file = /var/log/searchd.pid
}

回答1:


You can only implement one of them

min_infix_len =3 min_prefix_len = 3

Prefix is for *something

Infix can be used with everything..

Remove one of them



来源:https://stackoverflow.com/questions/5456413/searching-in-a-part-of-word-with-sphinx

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