Skip to content

vmvps/sphinx-jieba

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sphinx-jieba

Sphinx for Chinese with cppJieba

仿照Sphinx for Chinese,基于sphinx 2.2.9版本,结合cppJieba分词系统,让sphinx支持中文。

安装

解压

$ git clone https://github.com/vmvps/sphinx-jieba
$ cd sphinx-jieba

编译(假设安装到/usr/local/sphinx目录,下文同)

$ ./configure --prefix=/usr/local/sphinx
--prefix 指定安装路径
--with-mysql 编译mysql支持
--with-pgsql 编译pgsql支持
$ make
$ make install

配置中文支持

修改sphinx.conf索引配置文件

在索引配置项中添加以下两项:

charset_type = utf-8
chinese_dictionary = /usr/local/sphinx/etc/xdict

注意在source部分一定加上如下字段,否则中文分词无法起作用。

sql_query_pre = SET NAMES utf8

TODOs:

  1. 在index时,添加同义词功能 a. 本身在Sphinx GetToken时可以返回多个同义Token b. 增加同义词典
  2. 字典支持二进制形式
  3. cmake make sure the expat and int64_t varible set.

About

sphinx search engine with jieba tokenizer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 69.8%
  • C 12.3%
  • Shell 4.8%
  • PHP 4.1%
  • Makefile 3.2%
  • Ruby 1.3%
  • Other 4.5%