Sphinx 安装

Sphinx是由俄罗斯人Andrew Aksyonoff开发的一个全文检索引擎。意图为其他应用提供高速、低空间占用、高结果 相关度的全文搜索功能。由于开发要求Sphinx中文分词,安装环境,就做下笔记

[[email protected] mmseg-3.2.14]# yum -y install make gcc g++ gcc-c++ libtool autoconf automake imake 

[[email protected] mmseg-3.2.14]# yum install libxml2-devel expat-devel

[[email protected] sphinx]# tar xvf coreseek-3.2.14.tar.gz 

[[email protected] sphinx]# cd coreseek-3.2.14
[[email protected] coreseek-3.2.14]# cd mmseg-3.2.14/

[[email protected] mmseg-3.2.14]# aclocal

[[email protected] mmseg-3.2.14]# libtoolize --force 
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config‘.
libtoolize: linking file `config/ltmain.sh‘
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])‘ to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4‘ to ACLOCAL_AMFLAGS in Makefile.am.
[[email protected] mmseg-3.2.14]# 

[[email protected] mmseg-3.2.14]# automake --add-missing 
[[email protected] mmseg-3.2.14]# autoconf 
[[email protected] mmseg-3.2.14]# autoheader
[[email protected] mmseg-3.2.14]# make clean

[[email protected] mmseg-3.2.14]# ./configure --prefix=/usr/local/mmseg3

[[email protected] mmseg-3.2.14]# make && make install

[[email protected] coreseek-3.2.14]# cd csft-3.2.14/

[[email protected] csft-3.2.14]# sh buildconf.sh 

[[email protected] csft-3.2.14]# ./configure --prefix=/usr/local/coreseek  --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-

libs=/usr/local/mmseg3/lib/ --with-mysql

[[email protected] csft-3.2.14]# make && make install

[[email protected] testpack]# cat var/test/test.xml	#显示中文

[[email protected] testpack]# /usr/local/mmseg3/bin/mmseg -d /usr/local/mmseg3/etc var/test/test.xml
</x ?/x xml/x  /x version/x =/x "/x 1/x ./x 0/x "/x  /x encoding/x =/x "/x utf/x -/x 8/x "/x ?/x >/x 
</x sphinx/x :/x docset/x >/x 
        /x </x sphinx/x :/x schema/x >/x 
        /x </x sphinx/x :/x field/x  /x name/x =/x "/x subject/x "/x //x >/x  /x 
        /x </x sphinx/x :/x field/x  /x name/x =/x "/x content/x "/x //x >/x 
        /x </x sphinx/x :/x attr/x  /x name/x =/x "/x published/x "/x  /x type/x =/x "/x timestamp/x "/x //x >/x 
        /x </x sphinx/x :/x attr/x  /x name/x =/x "/x author/x _/x id/x "/x  /x type/x =/x "/x int/x "/x  /x bits/x =/x "/x 16/x "/x  /x default/x =/x "/x 1/x "/x //x >/x 
        /x </x //x sphinx/x :/x schema/x >/x 
        /x </x sphinx/x :/x document/x  /x id/x =/x "/x 1/x "/x >/x 
        /x      /x </x subject/x >/x 愚人/x 节/x 最佳/x 蛊惑/x 爆/x 料/x  /x 谷/x 歌/x 300/x 亿/x 美元/x 收购/x 百/x 度/x </x //x subject/x >/x 
        /x      /x </x published/x >/x 1270131607/x </x //x published/x >/x 
        /x      /x </x content/x >/x 据/x 国外/x 媒体/x 报道/x ,/x 谷/x 歌/x 将/x 巨资/x 收购/x 百/x 度/x ,/x 涉及/x 金额/x 高达/x 300/x 亿/x 美元/x 。/x 谷/x 歌/x 借/x 此/x 

重返/x 大陆/x 市场/x 。/x 
 /x  /x 该/x 报道/x 称/x ,/x 目前/x 谷/x 歌/x 与/x 百/x 度/x 已经/x 达成/x 了/x 收购/x 协议/x ,/x 将/x 择机/x 对外/x 公布/x 。/x 百/x 度/x 的/x 管理层/x 将/x 100/x %/x 保

留/x ,/x 但/x 会/x 将/x 项目/x 缩减/x ,/x 包括/x 有/x 啊/x 商城/x ,/x 以及/x 目前/x 实施/x 不力/x 的/x 凤/x 巢/x 计划/x 。/x 正在/x 进行/x 测试/x 阶段/x 的/x 视频/x 网站/x 

qiyi/x ./x com/x 将/x 输入/x 更/x 多/x 的/x Youtube/x 资源/x 。/x (/x YouTube/x 在/x 大陆/x 区/x 因/x 内容/x 审查/x 暂/x 不/x 能/x 访问/x )/x 。/x 

[[email protected] testpack]# /usr/local/coreseek/bin/indexer -c etc/csft.conf --all
Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r2117)]
Copyright (c) 2007-2011,
Beijing Choice Software Technologies Inc (http://www.coreseek.com)

 using config file ‘etc/csft.conf‘...
indexing index ‘xml‘...
collected 3 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 3 docs, 7585 bytes
total 0.008 sec, 945524 bytes/sec, 373.97 docs/sec
total 2 reads, 0.000 sec, 4.2 kb/call avg, 0.0 msec/call avg
total 7 writes, 0.000 sec, 3.1 kb/call avg, 0.0 msec/call avg

[[email protected] testpack]# /usr/local/coreseek/bin/search -c etc/csft.conf 结婚的和尚未结婚的
Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r2117)]
Copyright (c) 2007-2011,
Beijing Choice Software Technologies Inc (http://www.coreseek.com)

 using config file ‘etc/csft.conf‘...
index ‘xml‘: query ‘结婚的和尚未结婚的 ‘: returned 0 matches of 0 total in 0.004 sec

words:
1. ‘结婚‘: 0 documents, 0 hits
2. ‘的‘: 3 documents, 83 hits
3. ‘和‘: 3 documents, 15 hits
4. ‘尚未‘: 0 documents, 0 hits

[[email protected] python]#  /usr/local/coreseek/bin/searchd -c /opt/sphinx/coreseek-3.2.14/testpack/etc/csft_cjk.conf &
时间: 2024-08-04 05:10:17

Sphinx 安装的相关文章

Sphinx 安装与使用(1)-- 安装Coreseek

Coreseek就是Sphinx的中文版 官方网站 http://www.coreseek.cn/ 一.安装 1.修改LANG 永久修改: vim /etc/locale.conf LANG="zh_CN.UTF-8" 临时修改 export LANG="zh_CN.UTF-8" export LC_ALL="zh_CN.UTF-8" 2.安装依赖包 yum install make gcc g++ gcc-c++ libtool autocon

Sphinx安装配置及API调用实战手册

这几天项目中需要重新做一个关于商品的全文搜索功能,于是想到了用Sphinx,因为需要中文分词,所以选择了Sphinx for chinese,当然你也可以选择coreseek,建议这两个中选择一个,暂时不要选择原版Sphinx(对中文的支持不是很好).又因为服务器所用MySQL在当时编译时并没有编译Sphinx扩展,而重新编译MySQL并加入Sphinx暂时又无法实现(项目用到了多台服务器,在不影响现有业务的情况下不可能去重新编译MySQL的),所以采用的是程序通过API来外部调用Sphinx.

Sphinx安装流程及配合PHP使用经验

1.什么是Sphinx Sphinx是俄罗斯人Andrew Aksyonoff开发的高性能全文搜索软件包,在GPL与商业协议双许可协议下发行. 全文检索式指以文档的全部文本信息作为检索对象的一种信息检索技术.检索的对象有可能是文章的标题,也有可能是文章的作者,也有可能是文章的摘要或内容.常用于新闻,论坛评论等的模糊查询. 2.Sphinx的特性 高速索引(在新款CPU上,近10MB/S); 高速搜索(2-4G的文本量平均查询速度不到0.1秒); 高可用性(单CPU上最大可支持100GB的文本,1

Sphinx 安装与使用

Sphinx 优点 高速索引(接近10M/S) 高速搜索(2-4G文本搜索耗时不到0.1秒) 高可用性(单CPU支持100GB文本,100M文档) 提供相关性排名.分布式搜索.文档摘要(高亮显示) Sphinx 缺点 必须有主键 主键必须是整形 不负责数据存储 配置复杂 Sphinx是介于PHP和mysql的中间层,它提供比mysql更专业的搜索功能,性能更高,因为存在于mysql之前,可以更好的缓解数据库压力 安装 sudo apt-get install sphinxsearch -y 安装

centos下 rpm包sphinx安装的目录

sphinx: /etc/sphinx /usr/share/sphinx Sphinx installed! Now create a full-text index, start the search daemon, and you're all set. To manage indexes: editor /etc/sphinx/sphinx.conf To rebuild all disk indexes: sudo -u sphinx indexer --all --rotate To

coreseek(sphinx)安装2(mysql数据源配置和测试)

Windows操作系统下 mysql数据源配置: 主要步骤:  配置mysql数据源配置文件->生成索引->开启索引   (三步) coreseek\etc\csft_mysql.conf     (以下是我的配置文件) #源定义 source mysql { type                    = mysql            #表示mysql数据源 sql_host                = localhost          #数据库服务器链接,127.0.0.

Sphinx 安装与使用(2)-- 配置Coreseek

1.必须先关闭守护进程才能做其他的操作(第一次启动不需要这一步) /usr/local/coreseek/bin/searchd --config /usr/local/coreseek/etc/test.conf --stop 2.删掉原来的配置文件(第一次启动不需要这一步) cd /usr/local/coreseek/etc/ rm test.comf 3.重新设置配置文件 cd /usr/local/coreseek/etc/ vim test.conf 文件内容根据具体需求配置,具体需

sphinx安装

相关命令及步骤    创建主索引:        /usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/csft.conf --all    创建增量索引:        1. 创建测试数据表以及数据        2. 修改配置文件            主索引源:sql_query_pre            增量索引源:sql_query_pre  sql_query  sql_query_post            主

Sphinx学习之sphinx的安装篇

一.  Sphinx简介 Sphinx是由俄罗斯人Andrew Aksyonoff开发的一个全文检索引擎.意图为其他应用提供高速.低空间占用.高结果 相关度的全文搜索功能.Sphinx可以非常容易的与SQL数据库和脚本语言集成.当前系统内置MySQL和PostgreSQL 数据库数据源的支持,也支持从标准输入读取特定格式 的XML数据. Sphinx的特性如下: a)  高速的建立索引(在当代CPU上,峰值性能可达到10 MB/秒); b)  高性能的搜索(在2 – 4GB 的文本数据上,平均每