致命:在配置文件中找不到索引

时间:2015-03-19 12:31:44

标签: sphinx indexer

我正在尝试运行我的sphinx服务器的索引器。

这是我使用的命令(通过root访问权限)来启动索引:

indexer --all

当我使用命令时,这是我得到的反应:

Sphinx 2.1.9-id64-release (rel21-r4761)
Copyright (c) 2001-2014, Andrew Aksyonoff
Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'...
FATAL: no indexes found in config file '/etc/sphinxsearch/sphinx.conf'

这是位于/etc/sphinxsearch/

中的sphinx.conf文件
#############################################################################
## indexer settings
#############################################################################

indexer
{
    # memory limit, in bytes, kiloytes (16384K) or megabytes (256M)
    # optional, default is 32M, max is 2047M, recommended is 256M to 1024M
    mem_limit       = 1024M
}

#############################################################################
## searchd settings
#############################################################################

searchd
{
    listen          = 127.0.0.1:9312
    listen          = 127.0.0.1:9306:mysql41
    log         = /var/log/sphinxsearch/searchd.log
    query_log       = /var/log/sphinxsearch/query.log
    read_timeout        = 5
    client_timeout      = 300
    max_children        = 30
    pid_file        = /var/log/sphinxsearch/searchd.pid
    max_matches     = 1000
    seamless_rotate     = 1
    preopen_indexes     = 1
    unlink_old      = 1
    mva_updates_pool    = 1M
    max_packet_size     = 8M
    max_filters     = 256
    max_filter_values   = 4096
    workers         = threads # for RT to work
}

index myindex
{
    type = rt
    path = /var/www/vhosts/user/sphinx/myindex
    rt_field = description
    rt_field = searchcode
    rt_field = weight
    rt_field = productid
    rt_attr_uint = stockproduct
    rt_attr_uint = instock
    charset_type    = utf-8
    min_infix_len   = 3
    enable_star     = 1
    expand_keywords = 1
    dict            = keywords
}

# --eof--

有人可以帮我解决这个错误吗?

FATAL: no indexes found in config file '/etc/sphinxsearch/sphinx.conf

2 个答案:

答案 0 :(得分:6)

indexer命令仅适用于传统的磁盘索引。不是实时索引。

因为indexertype=rt没有做任何事情,所以它不会“看到”它们,因此您的配置文件没有索引索引。

我想在一个理想的世界里,它会说“找不到简单的索引”或类似的澄清其忽略的rt(同样忽略分布式)

答案 1 :(得分:-1)

您要做的就是将sphinx.conf文件放在bin文件夹中,这意味着它将位于此路径内,例如“ etc/sphinxsearch/bin/sphinx.conf”。