菜鸟国际电子游戏首页 > 文章中心 > 正文

sphinx3.2.1 搭建-电子游戏app下载


sphinx国际电子游戏官网下载页面()

cd /usr/local/src/
wget http://sphinxsearch.com/files/sphinx-3.2.1-f152e0b-linux-amd64-glibc2.12.tar.gz
//解压
tar sphinx-3.2.1-f152e0b-linux-amd64-glibc2.12.tar.gz
//建立软链
$ ln -s /usr/local/sphinx-3.2.1 /app/sphinx
//复制一个配置文件
cp /app/sphinx/etc/sphinx-mini.conf.dist /application/sphinx/etc/test.conf
//编辑配置文件
vim /app/sphinx/etc/test.conf


导入示例数据
> mysql -h127.0.0.1 -uroot -p < example.sql
> 输入数据库密码

mysql> use test
reading table information for completion of table and column names
you can turn off this feature to get a quicker startup with -a

----------------
| tables_in_test |
----------------
| documents |
| tags |
----------------


mysql> select * from documents;
---- ---------- ----------- --------------------- ----------------- --------------------------------------------------------
| id | group_id | group_id2 | date_added | title | content |
---- ---------- ----------- --------------------- ----------------- --------------------------------------------------------
| 1 | 1 | 5 | 2020-06-29 17:03:39 | test one | this is my test document number one. also phrases. |
| 2 | 1 | 6 | 2020-06-29 17:03:39 | test two | this is my test document number two |
| 3 | 2 | 7 | 2020-06-29 17:03:39 | another doc | this is another group |
| 4 | 2 | 8 | 2020-06-29 17:03:39 | doc number four | this is to test groups |
---- ---------- ----------- --------------------- ----------------- --------------------------------------------------------


测试配置
> ./bin/indexer --config etc/sphinx.conf
sphinx 3.2.1 (commit f152e0b)
国际电子游戏 copyright (c) 2001-2020, andrew aksyonoff
国际电子游戏 copyright (c) 2008-2016, sphinx technologies inc (http://sphinxsearch.com)

error: nothing to do.


如未成功或提示此段错误
error: index 'test1': sql_connect: failed to load libmysqlclient (or libmariadb) (dsn=mysql://root:***@localhost:3306/test).

安装(仅适用于centos)
yum install mysql-devel.x86_64


生成索引数据
./bin/searchd --config etc/sphinx.conf


停止服务
killall searchd


重新生成testindex索引数据
$./bin/indexer testindex  --config etc/sphinx.conf --rotate
//重新生成全部索引
./bin/indexer --all --config etc/sphinx.conf --rotate


 


搜狗词库()


转载请注明出处:

0

相关文章