【问题标题】:Sphinx search: getting rt indexing to work with mysql - first timeSphinx 搜索:让 rt 索引与 mysql 一起工作 - 第一次
【发布时间】:2013-08-08 07:23:22
【问题描述】:

我正在尝试让 rt 索引工作: http://sphinxsearch.com/docs/current.html#rt-overview

我缺少 sphinx 和 mysql 之间的链接。

在 sphinx.conf 我有:

index rt_test
{
        type = rt
        path = /home/my/path/sphinx/data/rt_test
        rt_field = title
        rt_field = content
}

我运行 /home/path/bin/indexer --all

它告诉我

skipping non-plain index 'rt_test'... (which I read is as it should be)

然后在mysql中(正常登录):

create table rt_test(id INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT, title varchar(100),
content varchar(100));

insert into rt_test(title, content) values ("test title", "test content");

SELECT * FROM rt_test WHERE MATCH('test');

这给了我一个“错误的语法”错误。这并不奇怪。 Mysql只是认为我 已经创建了正则表并插入了正则数据,现在看不懂 狮身人面像查询。

那么缺少的链接是什么? mysql 是如何知道 sphinx 的?如果我不先创建表,那么我会收到一个表不存在的错误(sphinx 没有创建要从 mysql 查询的“sphinx”表)。

我已经在 Linux 上安装了 sphinx,如下所述: http://sphinxsearch.com/docs/current.html#installing

使用这个版本:

wgethttp://sphinxsearch.com/files/sphinx-2.0.8-release.tar.gz

编辑:我也跑了 $searchd

It says:

WARNING: compat_sphinxql_magics=1 is deprecated; please update your applica
WARNING: preopen_indexes=1 has no effect with seamless_rotate=0
listening on all interfaces, port=9312
listening on all interfaces, port=9306
precaching index 'other'
precaching index 'rt_test'
precached 2 indexes in 0.012 sec

【问题讨论】:

    标签: sphinx


    【解决方案1】:

    我现在明白了。

    我没有登录到我的常规 mysql 数据库,但是(很有趣)按照它说的去做:

    $ mysql -h 127.0.0.1 -P 9306
    

    然后我不创建表。只需插入和搜索。

    我的常规数据库和 sphinx mysql 是完全分开的。我必须将所有数据插入到我的常规数据库和 sphinx 数据库中。然后在 sphinx 数据库中搜索并使用结果来获取我的常规数据库中的完整数据。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-21
      • 2013-08-01
      • 1970-01-01
      相关资源
      最近更新 更多