「Sphinx」- 全文搜索引擎

Open Source Search Server v2.1.1-release

Homepage: http://sphinxsearch.com/

Book: http://shop.oreilly.com/product/9780596809539.do%EF%BC%9B 介绍 Sphinx;

Download Page: http://sphinxsearch.com/downloads/release/

Download Link: http://sphinxsearch.com/files/sphinx-2.2.11-release.tar.gz

Manual: http://sphinxsearch.com/docs/latest/index.html%EF%BC%9B 源码目录下的doc/sphinx.html是当前版本的文档;

Installation: http://sphinxsearch.com/docs/latest/installation.html


indexer: “全文索引“生成工具;

searchd: 后台服务,负责执行对”全文索引“的搜索;

spelldump: 命令行工具,使用ispell 或 MySpell 格式的字典从”词形“中提取单词;(sphinx_source_dir/doc/sphinx.html)

indextool: 用于打印”全文索引“的多方面debug信息, 0.9.9-rc2 开始加入的;

wordbreaker: 分词工具,version 2.1.1 开始加入;

错误列表(Error List)

Error #1

> ./indexer –all

./indexer: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory

Solved #1

原因:mysql的安装目录/usr/local/mysql/libmysqlclient.so.20 不在环境变量中

# (1) 修改/etc/ld.so.conf,或者:

> ldconfig /usr/local/mysql/lib

# 修改环境变量(当然也可以):

> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mysql/lib/

PHP Sphinx Extension

Sphinx Client Manual: http://php.net/manual/en/book.sphinx.php

PECL Sphinx: http://pecl.php.net/package/sphinx

然而。。。。。。根本不需要安装扩展,这是 Version 2.1.1,
在源码目录的 api 文件夹下,有一个 sphinxapi.php,已经提供API了,开袋即食;
sphinxapi.php 中:

// As of 2015, we strongly recommend to use either SphinxQL or REST APIs
// rather than the native SphinxAPI.
// While both the native SphinxAPI protocol and the existing APIs will
// continue to exist, and perhaps should not even break (too much), exposing
// all the new features via multiple different native API implementations
// is too much of a support complication for us.