Giter VIP home page Giter VIP logo

sphinx's Introduction

sphinx

Sphinx for Chinese 网上的sphinx中文版(http://code.google.com/p/sphinx-for-chinese/)比较旧,所以根据需要改写 sphinx 2.2.9版本, 根据sphinx for chinese改写到sphinx2.2.9版本

sphinx-for-chinese安装 解压 $ git clone https://github.com/eric1688/sphinx $ cd sphinx

编译(假设安装到/usr/local/sphinx目录,下文同) $ ./configure --prefix=/usr/local/sphinx --prefix 指定安装路径 --with-mysql 编译mysql支持 --with-pgsql 编译pgsql支持 $ make $ make install

配置中文支持

$ tar -xvf xdict_1.1.tar.gz $ /usr/local/sphinx/bin/mkdict xdict_1.1.txt xdict #从xdict_1.1.txt生成xdict文件,xdict_1.1.txt文件可以根据需要进行修改 $ cp xdict /usr/local/sphinx/etc/

修改sphinx.conf索引配置文件

在索引配置项中添加以下两项 charset_type = utf-8 chinese_dictionary = /usr/local/sphinx/etc/xdict

注意在source部分一定加上 sql_query_pre = SET NAMES utf8 否则中文分词无法起作用。

至此,完成中文支持配置。

sphinx's People

Contributors

eric1688 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sphinx's Issues

rt索引不能使用中文

plain索引正常,rt索引中文不行
rt索引,不管 chinese_dictionary 是否打开,都无法搜索中文,结果为空,英文可以

index rt
{
	# chinese_dictionary	= /usr/local/sphinx/etc/xdict
	min_word_len	= 1
	ngram_len		= 1
	ngram_chars		= U+3000..U+2FA1F

	type			= rt
	path			= /usr/local/sphinx/var/data/rt
	rt_mem_limit	= 512M

	rt_field			= name
	rt_attr_uint		= cid
}

希望有更新!

大神,sphinx 2.2.10出了半年多了 求更新.

比对了大量代码,感觉sphinx.cpp 改起来超头痛。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.