Linux下搭建coreseek(sphinx+mmseg3)全文检索
测试平台:Center OS
1、设置环境,升级/安装系统基础依赖包:m4、autoconf、automake、libtool
#设置路径和中文环境:
$ export PATH=/usr/local/bin:$PATH
$ export LC_ALL=zh_CN.UTF-8
$ export LANG=zh_CN.UTF-8
#下载安装基础依赖包
$ curl -O -L http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz
$ tar -xzvf m4-1.4.13.tar.gz
$ cd m4-1.4.13
$ ./configure --prefix=/usr/local
$ make && make install
$ cd .. $ curl -O -L http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz
$ tar -xzvf autoconf-2.65.tar.gz
$ cd autoconf-2.65
$ ./configure --prefix=/usr/local
$ make && make install
$ cd .. $ curl -O -L http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz
$ tar xzvf automake-1.11.tar.gz
$ cd automake-1.11
$ ./configure --prefix=/usr/local
$ make && make install
$ cd .. $ curl -O -L http://mirrors.kernel.org/gnu/libtool/libtool-2.2.6b.tar.gz
$ tar xzvf libtool-2.2.6b.tar.gz
$ cd libtool-2.2.6b
$ ./configure --prefix=/usr/local
$ make && make install
$ cd ..
2、下载安装coreseek
#下载coreseek:
$ curl -O -L http://www.coreseek.cn/uploads/csft/3.2/coreseek-3.2.14.tar.gz
$ tar xzvf coreseek-3.2.14.tar.gz
$ cd coreseek-3.2.14 #安装mmseg
$ cd mmseg-3.2.14
$ ./bootstrap
$ ./configure --prefix=/usr/local/mmseg3
$ make && make install
$ cd ..
遇到的问题:
error: cannot find input file: src/Makefile.in
或者遇到其他类似error错误时...
解决方案:
依次执行下面的命令,我运行'aclocal'时又出现了错误,解决方案请看下文描述
yum -y install libtool
aclocal
libtoolize --force
automake --add-missing
autoconf
autoheader
make clean
#安装coreseek
$ cd csft-3.2.14
$ sh buildconf.sh #输出的warning信息可以忽略,如果出现error则需要解决
$ ./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
#如果提示mysql问题,可以查看MySQL数据源安装说明 http://www.coreseek.cn/product_install/install_on_bsd_linux/#mysql
$ make && make install
如果编译出错:
1、‘this->ExprEval’ instead.....
编辑sphinxexpr.cpp
将所有的:T val = ExprEval ( this->m_pArg, tMatch );
替换为:T val = this->ExprEval ( this->m_pArg, tMatch );
保存并重新编译
$ cd ..
##命令行测试mmseg分词,coreseek搜索(需要预先设置好字符集为zh_CN.UTF-8,确保正确显示中文)
$ cd testpack
$ cat var/test/test.xml #此时应该正确显示中文
$ /usr/local/mmseg3/bin/mmseg -d /usr/local/mmseg3/etc var/test/test.xml
$ /usr/local/coreseek/bin/indexer -c etc/csft.conf --all
$ /usr/local/coreseek/bin/search -c etc/csft.conf 网络搜索
遇到问题:
出现这个 xmlpipe2 support NOT compiled in. To use xmlpipe2, install missing XML libra 错误。
解决方案:
yum -y install expat expat-devel
依次安装后,从新编译coreseek,然后再生成索引,就可以通过了。
结果如下:
Coreseek Fulltext 4.1 [ Sphinx 2.0.2-dev (r2922)]
Copyright (c) 2007-2011,
Beijing Choice Software Technologies Inc (http://www.coreseek.com)
using config file 'etc/csft.conf'...
index 'xml': query '网络搜索 ': returned 1 matches of 1 total in 0.000 sec
displaying matches:
1. document=1, weight=1590, published=Thu Apr 1 07:20:07 2010, author_id=1
words:
1. '网络': 1 documents, 1 hits
2. '搜索': 2 documents, 5 hits
Linux下搭建coreseek(sphinx+mmseg3)全文检索的更多相关文章
- 搭建coreseek(sphinx+mmseg3)详细安装配置+php之sphinx扩展安装+php调用示例(转)
一个文档包含了安装.增量备份.扩展.api调用示例,省去了查找大量文章的时间. 搭建coreseek(sphinx+mmseg3)安装 [第一步] 先安装mmseg3 cd /var/install ...
- windows/Linux 下安装coreseek/sphinx
2013年12月8日 17:26:26 注意的地方: 1.配置文件的 数据源, 索引, 服务 这3处配置的路径要写成windows识别的路径,最好是绝对路径 2.安装windows服务的时候,可以不带 ...
- 搭建coreseek(sphinx+mmseg3)详细安装配置+php之sphinx扩展安装+php调用示例
http://blog.csdn.net/e421083458/article/details/21529969 常用的命令 ps -ef|grep searchd 如果你开了search服务后,你命 ...
- MongoDB学习笔记—Linux下搭建MongoDB环境
1.MongoDB简单说明 a MongoDB是由C++语言编写的一个基于分布式文件存储的开源数据库系统,它的目的在于为WEB应用提供可扩展的高性能数据存储解决方案. b MongoDB是一个介于关系 ...
- Linux下搭建个人网站
前不久在阿里买了一个服务器,然后开始第一次尝试搭建自己的个人网站.前端采用了bootstrap框架,后端采用的是PHP,数据库使用的是Mysql.新手第一次在linux下搭建遇见很多问题,在这里分享一 ...
- Linux下搭建PHP环境
转载于: http://www.uxtribe.com/php/405.html 该站下有系列PHP文章. 在Linux下搭建PHP环境比Windows下要复杂得多.除了安装Apache,PHP等软件 ...
- Java学习心得之 Linux下搭建Java环境
作者:枫雪庭 出处:http://www.cnblogs.com/FengXueTing-px/ 欢迎转载 Java学习心得之 Linux下搭建Java环境 1.前言2.JDK安装3.配置环境变量4. ...
- Java学习心得之 Linux下搭建JavaWeb环境
作者:枫雪庭 出处:http://www.cnblogs.com/FengXueTing-px/ 欢迎转载 Java学习心得之 Linux下搭建JavaWeb环境 1. 前言2. Java安装3. t ...
- Ruby学习心得之 Linux下搭建Ruby环境
作者:枫雪庭 出处:http://www.cnblogs.com/FengXueTing-px/ 欢迎转载 Ruby学习心得之 Linux下搭建Ruby环境1.前言2.Linux下安装Ruby环境 一 ...
随机推荐
- Android控制ScrollView滚动
有两种办法,第一种,使用scrollTo(),这个方法不需要handler,直接调用就行 第二种方式,使用fullScrol() 下面我们看一下这个函数: scrollView.fullScroll( ...
- Linux sort 命令
- 今天的收获: sort -t $'\t' 说明:sort 加-t 参数时,如果需要以 '\t' 分隔,需要写成上述形式.
- PostgresSQL的安装与基本命令使用
安装与配置 yum install http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-2.noarch.rpm ...
- C语言 活动安排问题之二
有若干个活动,第i个开始时间和结束时间是[Si,fi),活动之间不能交叠,要把活动都安排完,至少需要几个教室? #include <stdio.h> #include <string ...
- Google Code Jam 2016 Round 1B B
题意:给出两个数字位数相同,分别中间有若干位不知道,用问号表示.现在要求补全这两个数字,使得差值的绝对值最小,多解则取第一个数字的值最小的,再多解就取第二个数字最小的. 分析: 类似数位dp,但是很多 ...
- hashMap和hashTable的区别
每日总结,每天进步一点点 hashMap和hashTable的区别 1.父类:hashMap=>AbstractMap hashTable=>Dictionary 2.性能:hashMap ...
- Spring学习(三)
1,Spring的事务管理机制 Spring事务管理高层抽象主要包括3个接口,Spring的事务主要是由他们共同完成的: l PlatformTransactionManager:事务管理器-主要用于 ...
- webServer-----Spring 集成cxf笔录
目前webserver主要有俩中方式:1,传统的webserver标准集成方式-生成WSDL的xml文档. 2, 基于restful风格的webserver java RESTful We ...
- Android Studio上NDK/JNI开发环境问题
基础环境: 操作系统 —— Windows 7 Android Studio —— 1.5.1(android-studio-bundle-141.2456560-windows.exe) NDK — ...
- EChart数据的异步加载和更新
ECharts是国内开发一款图标插件,在网页中我们经常要用到图标显示,直接引用十分方便. 直接到ECharts主页调用插件 <!DOCTYPE html> <html style=& ...