Sphinx(搜索引擎)3 不读取 CSV 文件
Sphinx (search engine) 3 not reading CSV files
我正在尝试让 Sphinx 为 CSV 文件编制索引。在这一点上,我正试图让最简单的例子工作,但没有运气。
我正在使用:Sphinx 3.3.1(提交 b72d67b)
这是我的配置文件
source csvsrc
{
type = csvpipe
csvpipe_command = cat /home/ec2-user/sphinx/etc/example.csv
csvpipe_header = 1
csvpipe_attr_uint = gid
csvpipe_attr_string = title
csvpipe_attr_string = content
}
index csvtest
{
type = rt
source = csvsrc
path = /var/data/test5
morphology = stem_en
rt_field = gid
rt_field = title
rt_field = content
}
indexer
{
mem_limit = 128M
}
searchd
{
listen = 9312
listen = 9306:mysql41
log = /var/log/searchd.log
query_log = /var/log/query.log
pid_file = /var/log/searchd.pid
binlog_path = /var/data
}
这是我正在尝试读取的 csv 文件
gid, title, content
11, hello world, document number one
124, hello again, document number two
125, hello now, This is some stuff
126, hello cow, more test stuff and things
127, hello suess, box and sox and goats and moats
128, hello raven, nevermore said the thing
我正在运行执行命令
../bin/searchd --config /home/ec2-user/sphinx/etc/sphinx.conf
响应为:
using config file '/home/ec2-user/sphinx/etc/sphinx.conf'...
listening on all interfaces, port=9312
listening on all interfaces, port=9306
precaching index 'csvtest'
precached 1 indexes using 1 threads in 0.0 sec
要启动引擎,如果我 运行 索引器具有以下内容:
../bin/indexer --config /home/ec2-user/sphinx/etc/sphinx.conf
响应如下
Sphinx 3.3.1 (commit b72d67b)
Copyright (c) 2001-2020, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
ERROR: nothing to do.
所有这些都符合预期,但是当我连接到 MySQL 客户端时,我发现索引格式正确,但为空
$ mysql -h127.0.0.1 -P9306
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 3.3.1 (commit b72d67b)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]> describe csvtest
-> ;
+---------+--------+------------+------+
| Field | Type | Properties | Key |
+---------+--------+------------+------+
| id | bigint | | |
| gid | field | indexed | |
| title | field | indexed | |
| content | field | indexed | |
+---------+--------+------------+------+
4 rows in set (0.00 sec)
MySQL [(none)]> select * from csvtest;
Empty set (0.00 sec)
我需要更改什么才能真正将 csv 数据加载到索引中?
@barryhunter 在评论中解决了它。
我需要索引器上的 --all 才能真正索引。
我正在尝试让 Sphinx 为 CSV 文件编制索引。在这一点上,我正试图让最简单的例子工作,但没有运气。
我正在使用:Sphinx 3.3.1(提交 b72d67b)
这是我的配置文件
source csvsrc
{
type = csvpipe
csvpipe_command = cat /home/ec2-user/sphinx/etc/example.csv
csvpipe_header = 1
csvpipe_attr_uint = gid
csvpipe_attr_string = title
csvpipe_attr_string = content
}
index csvtest
{
type = rt
source = csvsrc
path = /var/data/test5
morphology = stem_en
rt_field = gid
rt_field = title
rt_field = content
}
indexer
{
mem_limit = 128M
}
searchd
{
listen = 9312
listen = 9306:mysql41
log = /var/log/searchd.log
query_log = /var/log/query.log
pid_file = /var/log/searchd.pid
binlog_path = /var/data
}
这是我正在尝试读取的 csv 文件
gid, title, content
11, hello world, document number one
124, hello again, document number two
125, hello now, This is some stuff
126, hello cow, more test stuff and things
127, hello suess, box and sox and goats and moats
128, hello raven, nevermore said the thing
我正在运行执行命令
../bin/searchd --config /home/ec2-user/sphinx/etc/sphinx.conf
响应为:
using config file '/home/ec2-user/sphinx/etc/sphinx.conf'...
listening on all interfaces, port=9312
listening on all interfaces, port=9306
precaching index 'csvtest'
precached 1 indexes using 1 threads in 0.0 sec
要启动引擎,如果我 运行 索引器具有以下内容:
../bin/indexer --config /home/ec2-user/sphinx/etc/sphinx.conf
响应如下
Sphinx 3.3.1 (commit b72d67b)
Copyright (c) 2001-2020, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
ERROR: nothing to do.
所有这些都符合预期,但是当我连接到 MySQL 客户端时,我发现索引格式正确,但为空
$ mysql -h127.0.0.1 -P9306
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 3.3.1 (commit b72d67b)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]> describe csvtest
-> ;
+---------+--------+------------+------+
| Field | Type | Properties | Key |
+---------+--------+------------+------+
| id | bigint | | |
| gid | field | indexed | |
| title | field | indexed | |
| content | field | indexed | |
+---------+--------+------------+------+
4 rows in set (0.00 sec)
MySQL [(none)]> select * from csvtest;
Empty set (0.00 sec)
我需要更改什么才能真正将 csv 数据加载到索引中?
@barryhunter 在评论中解决了它。
我需要索引器上的 --all 才能真正索引。