狮身人面像搜索结果为零

时间:2013-07-07 08:32:55

标签: linux centos sphinx

你刚刚在我的CentOS VPS上安装了Sphinx ..但是出于某种原因,每当我搜索时,它都没有给我结果..我正在使用ssh进行搜索..这是命令

 search --index sphinx_index_cc_post -a Introducing The New Solar Train Tunnel

这是命令的输出

Sphinx 2.0.5-release (r3308)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/usr/local/etc/sphinx.conf'...
index 'sphinx_index_cc_post': query 'Introducing The New Solar Train Tunnel ': returned 0 matches of 0 total in 0.000 sec

words:
1. 'introducing': 0 documents, 0 hits
2. 'the': 0 documents, 0 hits
3. 'new': 0 documents, 0 hits
4. 'solar': 0 documents, 0 hits
5. 'train': 0 documents, 0 hits
6. 'tunnel': 0 documents, 0 hits

这是配置文件中的索引

source sphinx_index_cc_post
{

    type                                    = mysql
    sql_host                                = localhost
    sql_user                                = user
    sql_pass                                = password
    sql_db                                  = database
    sql_port                                = 3306

    sql_query_range                 = SELECT MIN(postid),MAX(postid) FROM cc_post
    sql_range_step                  = 1000

    sql_query                               = SELECT postedby, category, totalvotes, trendvalue, featured, isactive, postingdate \
                                            FROM cc_post \
                                            WHERE  postid BETWEEN $start AND $end
}

index sphinx_index_cc_post
{
    source                  = sphinx_index_cc_post
    path                    = /usr/local/sphinx/data/sphinx_index_cc_post
    charset_type            = utf-8
    min_word_len    = 2
}

索引似乎工作正常,当我旋转索引时,我成功获取了文档。这是我的索引器的结果

[root@server1 data]# indexer --rotate sphinx_index_cc_post
Sphinx 2.0.5-release (r3308)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/usr/local/etc/sphinx.conf'...
indexing index 'sphinx_index_cc_post'...
WARNING: Attribute count is 0: switching to none docinfo
WARNING: source sphinx_index_cc_post: skipped 1 document(s) with zero/NULL ids
collected 2551 docs, 0.1 MB
sorted 0.0 Mhits, 100.0% done
total 2551 docs, 61900 bytes
total 0.041 sec, 1474933 bytes/sec, 60784.40 docs/sec
total 2 reads, 0.000 sec, 1.3 kb/call avg, 0.0 msec/call avg
total 6 writes, 0.000 sec, 1.0 kb/call avg, 0.0 msec/call avg
rotating indices: succesfully sent SIGHUP to searchd (pid=17888).

我也尝试删除属性但没有运气!我猜它是查询问题的一些配置问题

1 个答案:

答案 0 :(得分:1)

您的查询是:

SELECT postedby, category, totalvotes, trendvalue, featured, isactive, postingdate \
                                            FROM cc_post

来自列名称,我猜您在这些列中都没有全文。您是否遗漏了包含文字的列?