使用sphinxsearch搜索类似产品sku

时间:2013-02-22 07:44:01

标签: search kohana sphinx

我的电子商务网站上有搜索表单。搜索引擎是Sphinxsearch。

我的产品有sku(04078,PS04078,DS04078,04078-1,04078-2,4078-3)。


问题我无法弄清楚如何配置sphinx以获得我需要的结果:

按“04078”搜索只给出了sku 04078的项目,但不是全部6项。

如何获取结果集中的所有6个项目?

我的conf:

source products
{
        type                    = mysql
        sql_host                = #
        sql_user                = #
        sql_pass                = #
        sql_db                  = #
        sql_port                = # 
        sql_query_pre = SET CHARACTER SET utf8
        sql_query               = \
                SELECT id,price,name,sku,producer_name \
                                        FROM products
        #sql_attr_string         = post_title
        #sql_field_string        = post_content
        sql_query_info          = SELECT * FROM products WHERE id=$id

}

index products
{
        source                  = products
        path                    = /var/data/products
        docinfo                 = extern
        mlock                   = 0
        charset_type = utf-8
        html_strip = 1
        html_remove_elements = style, script
        enable_star = 1
        min_word_len = 1
        min_infix_len = 3
}

1 个答案:

答案 0 :(得分:0)

2.1.1测试版中的新正则表达式过滤器听起来只是将产品代码变成一致形式的票据......

http://sphinxsearch.googlecode.com/svn/trunk/doc/sphinx.html#conf-regexp-filter

相关问题