Sign inSign up

418250505/sphinx

By 418250505

Updated over 5 years ago

基于centos:7.6.1810镜像创建

Image
0

47

418250505/sphinx repository overview

运行测试

# 创建索引
/www/server/sphinx/bin/indexer -c /www/server/sphinx/etc/sphinx-test.conf --all
# 测试搜索
/www/server/sphinx/bin/search -c /www/server/sphinx/etc/sphinx-test.conf 网络搜索
# 启动搜索引擎
/www/server/sphinx/bin/searchd -c /www/server/sphinx/etc/sphinx-test.conf

在宿主机执行 sphinx 容器

docker exec -it sphinx /bin/bash -c '/www/server/sphinx/bin/search -c /www/wwwroot/docker/sphinx/src/coreseek/testpack/etc/csft.conf 网站'

php 扩展安装

# php扩展依赖libsphinxclient安装
cd coreseek/csft-3.2.14/api/libsphinxclient
./configure --prefix=/www/server/libsphinxclient
make
make install


# PHP7 使用下面的扩展
# 扩展下载地址:http://pecl.php.net/package/sphinx
wget http://git.php.net/?p=pecl/search_engine/sphinx.git;a=snapshot;h=9a3d08c67af0cad216aa0d38d39be71362667738;sf=tgz
tar -zxvf sphinx-php7.tar.gz
cd sphinx-339e123/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-sphinx=/www/server/libsphinxclient/
make
make install

# 扩展目录
/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/

## 扩展安装错误解决

# 错误:/usr/bin/ld: final link failed: Nonrepresentable section on output
# ubuntu
apt-get install libstdc++-8-dev

# 错误解决,修改源码
vim sphinxclient.c
# 找到
void sock_close ( int sock );
# 改为
static void sock_close ( int sock );

Tag summary

Content type

Image

Digest

Size

174.1 MB

Last updated

over 5 years ago

docker pull 418250505/sphinx:1.0