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

FATAL: no indexes found in config file

我正在尝试 运行 我的 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

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

因为 indexer 没有对 type=rt 做任何事情,所以 'see' 它们没有做任何事情,因此您的配置文件没有要索引的索引。

我想在一个理想的世界中它会说 'no plain indexes found' 或类似的东西来澄清它忽略 rt(与忽略分布式相同)

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