【问题标题】:Setting up Sphinx设置狮身人面像
【发布时间】:2010-11-28 16:13:30
【问题描述】:

呵呵,别笑我,只是想在我本地的 WAMP 上设置 Sphinx,我以前没有这样做过,所以我可能在做一些傻事。

这是我的 sphinx.conf 文件:

source code
{
    type = mysql
    sql_host = localhost
    sql_user = root
    sql_pass =
    sql_db = ****
    sql_port = 3306
    sql_query = SELECT id, language_id, category_id, title, description, UNIX_TIMESTAMP(time_posted) AS time_posted FROM codes
    sql_attr_uint = language_id
    sql_attr_uint = category_id
    sql_attr_timestamp = time_posted
    sql_query_info = SELECT id FROM codes WHERE id=$id
}

index code
{
    source = code
    path = C:/Program Files/Wampserver 2/sphinx/var/data/sphinx/code
    morphology = stem_en
    min_word_len = 3
    min_prefix_len = 0
}

searchd
{
    port = 3312
    log = C:/Program Files/Wampserver 2/sphinx/var/log/searchd/searchd.log
    query_log = C:/Program Files/Wampserver 2/sphinx/var/log/searchd/query.log
    pid_file = C:/Program Files/Wampserver 2/sphinx/var/log/searchd/searchd.pid
}

当我尝试建立索引时,我收到了这个错误:

ERROR: index 'code': column number 1 has no name.

这个问题的原因可能是什么? 谢谢。

【问题讨论】:

    标签: php mysql indexing sphinx


    【解决方案1】:

    需要libmysqlclient15-dev包版本与libmysqlclient15版本相同。你呢?

    【讨论】:

      【解决方案2】:

      没有什么明显的。我用这些列创建了一个表,在 Mac 和 Windows 机器上运行索引,并且两次都正确索引。我使用的是 sphinx 0.9.9-rc2,可能是版本问题?

      C:\Sphinx\bin>indexer.exe --config c:\Sphinx\test.conf
      Sphinx 0.9.9-rc2 (r1785)
      Copyright (c) 2001-2009, Andrew Aksyonoff
      
      using config file 'c:\Sphinx\test.conf'...
      WARNING: key 'port' is deprecated in c:\Sphinx\test.conf line 27; use 'listen' i
      nstead.
      total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
      total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
      
      C:\Sphinx\bin>
      

      【讨论】:

        【解决方案3】:

        【讨论】:

          【解决方案4】:

          只需将文件 bin/libmySQL.dll 替换为来自官方 PHP 发行版 php-5.2.1-Win32.zip 的 MySql 版本 5.0.37 中的相同文件即可。 p>

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2019-01-25
            • 1970-01-01
            相关资源
            最近更新 更多