V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
alex321
V2EX  ›  问与答

sphinx 查询没找到索引的问题求大佬指点,提示 WARNING: No extra index definitions found in data folder

  •  
  •   alex321 · 2018-03-02 16:48:43 +08:00 · 2916 次点击
    这是一个创建于 2246 天前的主题,其中的信息可能已经有所发展或是发生改变。
    情况是这样的,我用 sphinx 创建了本地索引。
    C:\Users\alex321>"D:\sphinx\bin\indexer.exe" --config "D:\sphinx\bin\sphinx.conf" --all
    Sphinx 3.0.2 (commit 2592786)
    Copyright (c) 2001-2018, Andrew Aksyonoff
    Copyright (c) 2008-2016, Sphinx Technologies Inc ( http://sphinxsearch.com)

    using config file 'D:\sphinx\bin\sphinx.conf'...
    indexing index 'test1'...
    collected 3547 docs, 2.9 MB
    sorted 0.2 Mhits, 100.0% done
    total 3547 docs, 2.943 Mb
    total 0.2 sec, 18.50 Mb/sec, 22302 docs/sec
    skipping non-plain index 'testrt'...

    然后,启动 searchd
    C:\Users\alex321>"D:\sphinx\bin\searchd.exe" --config "D:\sphinx\bin\sphinx.conf"
    Sphinx 3.0.2 (commit 2592786)
    Copyright (c) 2001-2018, Andrew Aksyonoff
    Copyright (c) 2008-2016, Sphinx Technologies Inc ( http://sphinxsearch.com)

    listening on all interfaces, port=9312
    listening on all interfaces, port=9306
    WARNING: No extra index definitions found in data folder
    accepting connections
    prereading 0 indexes
    prereaded 0 indexes in 0.001 sec
    query error: unknown local index 'test1' in search request
    query error: unknown local index 'test1' in search request

    实际看到 data 目录下是有 test1 开头的多个文件的。
    test1.sha
    test1.spa
    test1.spd
    test1.spe
    test1.sph
    test1.spi
    test1.spj
    test1.spk
    test1.spp

    然后,sphinx.conf 文件是直接拿 etc 下的 mini 进行修改的。
    #
    # Minimal Sphinx configuration sample (clean, simple, functional)
    #

    source src1
    {
    type = mysql

    sql_host = localhost
    sql_user = test
    sql_pass = test
    sql_db = test
    sql_port = 3306 # optional, default is 3306

    sql_query = 查询语句

    sql_attr_uint = id
    sql_attr_timestamp = time

    sql_query_pre = SET NAMES utf8
    }


    index test1
    {
    source = src1
    path = D:\sphinx\data\test1
    }


    index testrt
    {
    type = rt
    rt_mem_limit = 128M

    path = D:\sphinx\data\testrt

    rt_field = title
    rt_field = content
    rt_attr_uint = gid
    }


    indexer
    {
    mem_limit = 128M
    }


    searchd
    {
    listen = 9312
    listen = 9306:mysql41
    log = D:\sphinx\log\searchd.log
    query_log = log/query.log
    read_timeout = 5
    max_children = 30
    pid_file = D:\sphinx\log\searchd.pid
    seamless_rotate = 1
    preopen_indexes= 1
    unlink_old = 1
    workers = threads # for RT to work
    binlog_path = data
    }
    3 条回复    2018-08-31 17:40:02 +08:00
    zqunor1995
        1
    zqunor1995  
       2018-07-18 20:31:32 +08:00
    请问楼主解决这个问题了吗?我也是这个问题,找不到问题的根源,
    WongYukloong
        2
    WongYukloong  
       2018-08-31 17:22:14 +08:00
    请问楼主解决这个问题了吗?我也是这个问题,找不到问题的根源
    WongYukloong
        3
    WongYukloong  
       2018-08-31 17:40:02 +08:00
    @zqunor1995 在 sphinx.conf 中的 searchd 里面把 binlog_path 注释掉就好了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   992 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 20:44 · PVG 04:44 · LAX 13:44 · JFK 16:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.