一、

32位版本:

coreseek安装需要预装的软件:
apt-get install make gcc g++ automake libtool mysql-client libmysqlclient15-dev libxml2-dev libexpat1-dev
 
二、
CoreSeek快速安装:
安装前,建议查看:源码包说明README;4.0/4.1版可参考3.2版本安装,步骤相同;如遇到问题,请看详细安装说明。
 
##下载coreseek:coreseek 3.2.14:点击下载、coreseek 4.0.1:点击下载、coreseek 4.1:点击下载
$ wget http://www.coreseek.cn/uploads/csft/3.2/coreseek-3.2.14.tar.gz
$ 或者 http://www.coreseek.cn/uploads/csft/4.0/coreseek-4.0.1-beta.tar.gz
$ 或者 http://www.coreseek.cn/uploads/csft/4.0/coreseek-4.1-beta.tar.gz
$ tar xzvf coreseek-3.2.14.tar.gz 或者 coreseek-4.0.1-beta.tar.gz 或者 coreseek-4.1-beta.tar.gz
$ cd coreseek-3.2.14 或者 coreseek-4.0.1-beta 或者 coreseek-4.1-beta
 
##前提:需提前安装操作系统基础开发库及mysql依赖库以支持mysql数据源和xml数据源
##安装mmseg
$ cd mmseg-3.2.14
$ ./bootstrap #输出的warning信息可以忽略,如果出现error则需要解决
$ ./configure --prefix=/usr/local/mmseg3
$ make && make install
$ cd ..
 
##安装coreseek
$ cd csft-3.2.14 或者 cd csft-4.0.1 或者 cd csft-4.1
$ 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数据源安装说明
上一步安装的过程 可能出现的错误:
configuring Sphinx
------------------
checking for CFLAGS needed for pthreads... -pthread
checking for LIBS needed for pthreads... -lpthread
checking for pthreads... found
checking whether to compile with MySQL support... yes
checking for mysql_config... not found
checking MySQL include files... configure: error: missing include files.
******************************************************************************
ERROR: cannot find MySQL include files.
Check that you do have MySQL include files installed.
The package name is typically 'mysql-devel'.
If include files are installed on your system, but you are still getting
this message, you should do one of the following:
1) either specify includes location explicitly, using --with-mysql-includes;
2) or specify MySQL installation root location explicitly, using --with-mysql;
3) or make sure that the path to 'mysql_config' program is listed in
   your PATH environment variable.
To disable MySQL support, use --without-mysql option.
******************************************************************************
解决方案执行:
apt-get update
apt-get install libmysqlclient15-dev
 
 
 
$ make && make install
$ 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 网络搜索
安装测试完成。
 
查看版本信息
$ /usr/local/coreseek/bin/indexer -c etc/csft.conf --all
 
##如要停止搜索服务,请使用
/usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/csft_mysql.conf --stop
如果出现下面的错误:
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 '/usr/local/coreseek/etc/mysql_csft.conf'...
FATAL: failed to parse config file '/usr/local/coreseek/etc/mysql_csft.conf'
解决办法:
/usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/csft_mysql.conf --pidfile
 
 
启动服务:
/usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/csft_mysql.conf --console
 
 
##如要已启动服务,要更新索引,请使用
/usr/local/coreseek/bin/indexer -c etc/csft.conf --all --rotate
 
生成索引
/usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/csft_mysql.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 '/usr/local/coreseek/etc/csft_mysql.conf'...
indexing index 'mysql'...
collected 3 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 3 docs, 7545 bytes
total 0.018 sec, 416069 bytes/sec, 165.43 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
 
 
搜索
/usr/local/coreseek/bin/search -c /usr/local/coreseek/etc/csft_mysql.conf 百度收购
 
结合php使用:
require ( "sphinxapi.php" );
$sph = new SphinxClient ();
$sph -> SetServer ('10.2.6.101', 9312 );
$sph -> setMatchMode(SPH_MATCH_ANY);
//$sph -> SetArrayResult ( true );
$sph -> SetLimits(0, 15, 1000);
$sph -> SetMaxQueryTime(10);
 
$index = 'index_main1';
$dbname = 'test';
$table = 'documents';
 
$result = $sph->Query ($wd, $index);
if($result == false)
{
 echo '<pre>';
 var_dump ($sph->GetLastError());exit();
}
 
if(isset($result['total_found']) && $result['total_found']>0)
{
 $matches = $result['matches'];
 $keys = array_keys($matches);
 
 include 'MiniMysql.php';
 $db = new MiniMysql(array('host'=>'localhost','user'=>'root','pwd'=>'root','dbname'=>$dbname,'prefix'=>'mj_'));
 $list = $db -> getArray('SELECT id,title,content FROM `'.$table.'` WHERE id IN ('.implode(',',$keys).')');
 
 $html = array();
 $keys = array_flip($keys);
 $opts = array(
  'before_match' => '<font style=\'font-weight:bold;color:red\'>',
  'after_match' => '</font>',
  'limit' => 150,
 );
 foreach ($list as $key => $val )
 {
  $tmp = $sph->buildExcerpts($val,'index_main1',$wd,$opts);
  $html[$keys[$val['id']]] =
   '<div>'.
    '<a href="" title="" target="">'.$tmp['1'].'</a>'.
    '<p class="brief">'.$tmp['2'].'</p>'.
   '</div>';
 
  //$html[] = $html[$keys[$val['id']]] = '<div><a href="" title="" target="">'.$val['title'].'</a></div>';
 }
 ksort($html);
 echo implode('',$html);
}
else
{
 echo '';
 exit();
}
 
 
 
 

ubuntu-10.04的测试环境 安装测试 Coreseek开源中文检索引擎-Sphinx中文版的更多相关文章

  1. Ubuntu 16.04下Java环境安装与配置

    首先下载linux下的安装包 登陆网址https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.h ...

  2. Ubuntu 11.04 LAMP+JSP环境安装过程

    安装LAMP命令:sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server libapache2-mod-auth-mysq ...

  3. 在ubuntu 10.04 上QGIS的安装步骤

    进入管理员账户后,打开/etc/apt/sources.list. 添 加 deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubun ...

  4. ubuntu 10.04 安装arm交叉编译器

    家里有一台cotext-A9(armv7-a) 的盒子,现在不用了, 一直想着废物利用.于是想怎么为这盒子编译程序. 目标机器: root@routon-h1:/# uname -a Linux ro ...

  5. 阿里云ECS服务器环境搭建(1) —— ubuntu 16.04 图形界面的安装

    阿里云ECS服务器环境搭建(1) —— ubuntu 16.04 图形界面的安装1. 背景在我们购买阿里云ECS服务器之后,默认的系统环境是很干净的,我购买的是ubuntu16.04,远程登录进入之后 ...

  6. [转载]SharePoint 2013测试环境安装配置指南

    软件版本 Windows Server 2012 标准版 SQL Server 2012 标准版 SharePoint Server 2013 企业版 Office Web Apps 2013 备注: ...

  7. ubuntu 10.04 安装qt 5.0.2

    转自ubuntu 10.04 安装qt 5.0.2 从qt project网站下载下来最新的qt5.0.2套件,发现是个.run文件,添加x属性,然后直接sudo ./****.run, 提示  /l ...

  8. Ubuntu 10.04 安装Qt4.8.1 源码后字体模糊的问题

    Ubuntu 10.04 安装QT4.8.1 源码后字体模糊的问题. 附加解决 QT SDK 4.8.1 链接失败的问题 Ubuntu 10.04 编译QT源码后,编译程序,运行后IPA字体无法正常显 ...

  9. Ubuntu 10.04 安装流程

    ubuntu 10.04 安装流程   需安装libxrender-dev才能跑html5           来自为知笔记(Wiz)

随机推荐

  1. SQL中的去重操作

    if not object_id('Tempdb..#T') is null drop table #T Go Create table #T([ID] ),[Memo] nvarchar()) In ...

  2. 【转】使用Navicat for Oracle新建表空间、用户及权限赋予

    首先.我们来新建一个表空间.打开Navicat for Oracle,输入相关的的连接信息.如下图: 填入正确的信息,连接后.我们点击面板上的“其他”下的选项“表空间”,如下图: 进入表空间的界面,我 ...

  3. SQL SERVER2012 无法连接远程服务器

    SQL SERVER2012 无法连接远程服务器,报"尝试读取受保护的内存"错误. 解决方法: 运行CMD,输入 netsh winsock reset,回车.重启SSMS,搞定.

  4. Xcode升级7.3 自动补全不提示导入的自定义类解决方案

    见图:

  5. OC字符串的常用方法

    网上写的关于字符串常用方法的博客很多,这里我简单做了下总结!不喜勿喷哦! 一.创建字符串 #import <Foundation/Foundation.h> //NSString //创建 ...

  6. Ubuntu14.04(64位)安装ATI_Radeon_R7_M265显卡驱动

    电脑型号:Dell inspiron 14-5447 笔记本 显卡配置:集成显卡Intel核心显卡,Cpu是i5-4210U;独立显卡ATI_Radeon_R7_M265 网上关于ATI/Intel双 ...

  7. PHP的接口类(interface)和抽象类(abstract)的区别

    <?php /** * 接口类:interface * 其实他们的作用很简单,当有很多人一起开发一个项目时,可能都会去调用别人写的一些类, * 那你就会问,我怎么知道他的某个功能的实现方法是怎么 ...

  8. silverlight imagesource赋值与转换

    介绍几种常用的Image source 赋值方式: this.abc.Source = new BitmapImage(new Uri("/1.jpg", UriKind.Rela ...

  9. MVC3 带查询的分页Helper

    接上篇mvc3 分页Helper. 带查询的分页Helper是在上一篇分页的基础上来的.下面看代码: 首先,在System.Web.Mvc命名空间下的自定义类HtmlPage下面添加一个用于处理“查询 ...

  10. 升级linux内核(2.6.32->3.10.81),安装docker

    1.内核升级环境准备 #查看已经安装的和未安装的软件包组,来判断我们是否安装了相应的开发环境和开发库: yum grouplist #一般是安装这两个软件包组,这样做会确定你拥有编译时所需的一切工具 ...