位置: 编程技术 - 正文

centos下coreseek安装及使用方法(centos coreos)

编辑:rootadmin

推荐整理分享centos下coreseek安装及使用方法(centos coreos),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:centos安装 kernel panic,centos7(core),centos coreos,centos 安装kernel source,centos安装kernel-devel,centos 安装kernel source,centos core,centos core,内容如对您有帮助,希望把文章链接给更多的朋友!

Coreseek 中文全文检索引擎 Coreseek 是一款中文全文检索/搜索软件,以GPLv2许可协议开源发布,基于Sphinx研发并独立发布,专攻中文搜索和信息处理领域,适用于行业/垂直搜索、论坛/站内搜索、数据库搜索、文档/文献检索、信息检索、数据挖掘等应用场景,用户可以免费下载使用 一,coreseek 简介 官方 Coreseek 是一款中文全文检索/搜索软件,以GPLv2许可协议开源发布,基于Sphinx研发并独立发布,专攻中文搜索和信息处理领域,适用于行业/垂直搜索、论坛/站内搜索、数据库搜索、文档/文献检索、信息检索、数据挖掘等应用场景。商业使用(例如, 嵌入到其他程序中)需要获得商业授权。 Coreseek是一个支持中文的全文搜索引擎,意图为其他应用提供高速、低空间占用、高相关度结果的中文全文搜索能力。CoreSeek可以非常容易的与SQL数据库和脚本语言集成。 在Sphinx发行版本中提供的原生搜索API支持PHP、Python、Perl、Rudy和Java。搜索API非常轻量化,可以在几个小时之内移植到新的语言上。第三方API接口和插件提供了对Perl、C#、Haskell、Ruby-on-Rails支持,以及对其他可能的语言或者框架的支持。 版本介绍 Coreseek 3.2 稳定版 Coreseek 4.1 测式版 Coreseek 5 最新版 二,安装Coreseek 注:本文是以centos+mysql做为数据源支持为基础的coreseek安装教程.mysql安装略过. 1,下载coreseek 3.2稳定版,下载其他版本请去官网自行下载 cd /usr/local/src/ wget tar xzvf coreseek-3.2..tar.gz cd coreseek-3.2. 安装coreseek之前需要先安装需要预装的软件:yum install make gcc g++ gcc-c++ libtool autoconf automake imake mysql-devel libxml2-devel expat-devel (注:这是centos 位 其他系统请参考 2,安装mmseg $ cd mmseg-3.2. $ ./bootstrap #输出的warning信息可以忽略,如果出现error则需要解决 $ ./configure --prefix=/usr/local/mmseg3 $ make && make install $ cd .. ##如果提示libtool: unrecognized option `--tag=CC' ,请查看libtool问题解决方案 ##安装完成后,mmseg使用的词典和配置文件,将自动安装到/usr/local/mmseg3/etc中 ##中文分词测试,如果显示不正常,请检查当前环境下的locale和UTF-8中文字符显示设置 $ /usr/local/mmseg3/bin/mmseg -d /usr/local/mmseg3/etc src/t1.txt 中文/x 分/x 词/x 测试/x 中国人/x 上海市/x Word Splite took: 1 ms. 3,安装coreseek $ cd csft-3.2. ##执行configure,进行编译配置: $ sh buildconf.sh $ ./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 includes file则使用下面的编译命令 ./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-includes=/alidata/server/mysql/include/ --with-mysql-libs=/alidata/server/mysql/bin/ make && make install 4,测式coreseek cd ../testpack $ /usr/local/coreseek/bin/indexer -c etc/csft.conf ##以下为正常情况下的提示信息: Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r)] Copyright (c) -, Beijing Choice Software Technologies Inc ( using config file 'etc/csft.conf'... total 0 reads, 0. sec, 0.0 kb/call avg, 0.0 msec/call avg total 0 writes, 0. sec, 0.0 kb/call avg, 0.0 msec/call avg ## ##csft-4.0版显示:ERROR: nothing to do. ## $ /usr/local/coreseek/bin/indexer -c etc/csft.conf --all ##以下为正常索引全部数据时的提示信息:(csft-4.0版类似) Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r)] Copyright (c) -, Beijing Choice Software Technologies Inc ( using config file 'etc/csft.conf'... indexing index 'xml'... collected 3 docs, 0.0 MB sorted 0.0 Mhits, .0% done total 3 docs, bytes total 0. sec, bytes/sec, . docs/sec total 2 reads, 0. sec, 5.6 kb/call avg, 0.0 msec/call avg total 7 writes, 0. sec, 3.9 kb/call avg, 0.0 msec/call avg $ /usr/local/coreseek/bin/indexer -c etc/csft.conf xml ##以下为正常索引指定数据时的提示信息:(csft-4.0版类似) Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r)] Copyright (c) -, Beijing Choice Software Technologies Inc ( using config file 'etc/csft.conf'... indexing index 'xml'... collected 3 docs, 0.0 MB sorted 0.0 Mhits, .0% done total 3 docs, bytes total 0. sec, bytes/sec, . docs/sec total 2 reads, 0. sec, 5.6 kb/call avg, 0.0 msec/call avg total 7 writes, 0. sec, 3.9 kb/call avg, 0.0 msec/call avg $ /usr/local/coreseek/bin/search -c etc/csft.conf ##以下为正常测试搜索时的提示信息:(csft-4.0版类似) Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r)] Copyright (c) -, Beijing Choice Software Technologies Inc ( using config file 'etc/csft.conf'... index 'xml': query '': returned 3 matches of 3 total in 0. sec displaying matches: 1. document=1, weight=1, published=Thu Apr 1 :: , author_id=1 2. document=2, weight=1, published=Thu Apr 1 :: , author_id=1 3. document=3, weight=1, published=Thu Apr 1 :: , author_id=2 words: $ /usr/local/coreseek/bin/search -c etc/csft.conf -a Twittter和Opera都提供了搜索服务 ##以下为正常测试搜索关键词时的提示信息:(csft-4.0版类似) Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r)] Copyright (c) -, Beijing Choice Software Technologies Inc ( using config file 'etc/csft.conf'... index 'xml': query 'Twittter和Opera都提供了搜索服务 ': returned 3 matches of 3 total in 0. sec displaying matches: 1. document=3, weight=, published=Thu Apr 1 :: , author_id=2 2. document=1, weight=4, published=Thu Apr 1 :: , author_id=1 3. document=2, weight=3, published=Thu Apr 1 :: , author_id=1 words: 1. 'twittter': 1 documents, 3 hits 2. '和': 3 documents, hits 3. 'opera': 1 documents, hits 4. '都': 2 documents, 4 hits 5. '提供': 0 documents, 0 hits 6. '了': 3 documents, hits 7. '搜索': 2 documents, 5 hits 8. '服务': 1 documents, 1 hits $ /usr/local/coreseek/bin/searchd -c etc/csft.conf ##以下为正常开启搜索服务时的提示信息:(csft-4.0版类似) Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release (r)] Copyright (c) -, Beijing Choice Software Technologies Inc ( using config file 'etc/csft.conf'... listening on all interfaces, port= 三,配置coreseek支持mysql数据源 1,配置csft_mysql.conf文件 复制mysql配置文件到coreseek安装目录etc/下(比如/usr/local/coreseek/etc/) cp /usr/local/src/coreseek-3.2./testpack/etc/csft_mysql.conf /usr/local/coreseek/etc/ cd /usr/local/coreseek/etc/ vi csft_mysql.conf 下面加红部分是需要你自己配置的 官方参考文档:数据源配置:mysql数据源 phperz{ type = mysql

sql_host = localhost sql_user = root sql_pass = xxxx sql_db = phperz sql_port = sql_query_pre = SET NAMES utf8

sql_query = SELECT id,title,descs,status from article #sql_query第一列id需为整数 #title、content作为字符串/文本字段,被全文索引 sql_attr_uint = status #从SQL读取到的值必须为整数 #sql_attr_timestamp = date_added #从SQL读取到的值必须为整数,作为时间属性

sql_query_info_pre = SET NAMES utf8 #命令行查询时,设置正确的字符集 sql_query_info = SELECT * FROM article WHERE id=$id #命令行查询时,从数据库读取原始数据信息}

#index定义index phperz{ source = phperz #对应的source名称 path = /usr/local/coreseek/var/data/phperz #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/... docinfo = extern mlock = 0 morphology = none min_word_len = 1 html_strip = 0

#中文分词配置,详情请查看: charset_dictpath = /usr/local/mmseg3/etc/ #BSD、Linux环境下设置,/符号结尾 #charset_dictpath = etc/ #Windows环境下设置,/符号结尾,最好给出绝对路径,例如:C:/usr/local/coreseek/etc/... charset_type = zh_cn.utf-8}#全局index定义indexer{ mem_limit = M}

#searchd服务定义searchd{ listen = read_timeout = 5 max_children = max_matches = seamless_rotate = 0 preopen_indexes = 0 unlink_old = 1 pid_file = /usr/local/coreseek/var/log/searchd_mysql.pid #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/... log = /usr/local/coreseek/var/log/searchd_mysql.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/... query_log = /usr/local/coreseek/var/log/query_mysql.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...}==============================================================

centos下coreseek安装及使用方法(centos coreos)

2,建立索引路经部分需要改成你自己的地址/usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/csft_mysql.conf --all

可能出现的错误ERROR: index 'phperz': sql_connect: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) (DSN= -s /tmp/mysql.sock /var/lib/mysql/mysql.sock

四,coreseek+php使用方式复制安装止录下的/usr/local/src/coreseek-3.2./testpack/api/sphinxapi.php文件到你的项目里你的程序里include sphinxapi.phpphp使用方法见/usr/local/src/coreseek-3.2./testpack/api/test.php另附我的使用方法:===============================================================$wd = trim($_GET['wd']);include_once(JF_PATH."/config/sph_cfg.php");include_once(JF_PATH."/include/sphinxapi.php");$cl = new SphinxClient();$cl->SetServer(SPH_SERVER_HOST, SPH_SERVER_POST);$cl->SetConnectTimeout(3);$cl->SetArrayResult(true);$cl->SetMatchMode(1);$cl->SetFilter("status", array(1));$cl->SetLimits(0, );$res = $cl->Query($wd, "phperz_www");

if ($res['matches']) {$rownum = $res['total'];foreach ($res['matches'] as $k => $v) {$re = $this->db->get_one("select * from article where id=".$v['id']);if (!empty($re)) { $list[] = $re;}}}print_r($list);===============================================================

五,coreseek日常维护

启动/usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/csft_mysql.conf停止/usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/csft_mysql.conf --stop建立索引/usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/csft_mysql.conf --all重建索引/usr/local/coreseek/bin/indexer -c /usr/local/coreseek/etc/csft_mysql.conf --all --rotate

你需要把启动命令加到开机自启动里把重建索引命令加到计划任务里每天执行

本文为phperz原创,转载请注明出处.

CentOS中安装使用截图应用程序Shutter的教程 到了linux下之后才知道QQ的截图功能有多么好用,可惜linux下没有。CentOS自带的截图工具TakeScreenShot功能比较简单,有时候想在载的图上画条横线都不行,

在CentOS中安装EPEL包管理器及添加EPEL源的教程 在CentOS上安装EPEL要想安装EPEL,我们先要下载EPEL的rpm安装包。CentOS/RHEL下的6.x和5.x版本下载页面如下:

详解CentOS中使用rm命令将文件移到回收站的方法 今天在终端下,看到我的用户目录下有个~的文件夹(maven生成),相要删除收回点空间,习惯性的用命令rm-rf~,一回车,猛然想起的时候已经来不及了

标签: centos coreos

本文链接地址:https://www.jiuchutong.com/biancheng/353572.html 转载请保留说明!

上一篇:CentOS中Xen虚拟机的安装与基本操作教程 (centos vmware)

下一篇:CentOS中安装使用截图应用程序Shutter的教程(centos 安装教程)

  • 个人独资企业税种有哪些
  • 增值税发票综合服务平台错误代码35
  • 办公室购买清洁剂
  • 抵扣旅客运输增值税报表怎么填
  • 技术合同免税备案流程2022年
  • 发票没作废写上作废了怎么办
  • 企业接受赠予企业固定资产是否免税
  • 对方公司倒闭应收账款发票还需要开吗
  • 幼儿园增值税优惠政策
  • 未分配利润调整会计分录
  • 赠品转做商品销售的账务处理如何做?
  • 微信小程序实现微信支付
  • 申报专项资金项目是什么
  • 资本公积金转增股本
  • 对子公司计提减值准备影响合并利润吗
  • 实际销售金额是含税还是不含税
  • 已计提的存货跌价准备确认为净损失吗
  • xlsx长数字
  • 个贷系统平帐专户A贷
  • 出口转内销发票抵扣
  • 查账补缴的税的账怎么做
  • linux获取操作命令的使用方法
  • reg.dll是什么
  • Chon湖上空的低空云,苏格兰特罗萨克斯 (© Alistair Dick/Alamy)
  • phpifelse
  • 可以享受企业所得税加计扣除的有
  • 社保缴费基数差1000一般差多少?
  • yii框架的优点及原理
  • nginx搭建静态资源服务器
  • json_server
  • html前端开发教程
  • 拿到领料单如何做账
  • 增值税普通发票查询真伪
  • 企业所得税是先预缴吗
  • 开票品名不一样有什么关系
  • 什么叫python的开发环境
  • 购买牵引车和挂车购车流程
  • 大学生创新创业平台
  • 分公司转款总公司总公司怎样会计处理
  • 印花税报少了交税了怎么办
  • mongodb修改数据库名称
  • 任意盈余公积金的用途
  • 淘宝上买资料可以退吗
  • 增值税留抵税款制度
  • 领款单有法律效力吗
  • 现金支付什么会计科目
  • 用于企业职工福利有哪些
  • 租出的固定资产
  • 存货核算科目设置
  • 回收材料的好处和问题
  • 废品回收利用公司
  • 预收账款账务处理流程图
  • 远程认证软件可以卸载吗
  • 出口转内销进项税额怎么进附表二
  • mysqldump -h
  • mysqlw3school
  • Ubuntu下MySQL安装及配置远程登录教程
  • Excel导入Sqlserver数据库脚本
  • Win7旗舰版系统镜像文件
  • XP系统怎么删除密码
  • ubuntu 16.04
  • windows地图导航
  • ubuntu顶部菜单栏
  • linux批量处理文件
  • windows下合并分区
  • call to OpenGL ES API with no current context (logged once per thread)
  • cocos2dx官方教程
  • 批处理是什么意思
  • unity编辑工具软件介绍
  • javascript的if
  • shell 1
  • JavaScript函数中,哪个语句可以返回值
  • 个人总结的几个方面
  • python利用range产生列表
  • fragment详解
  • 12366纳税服务热线存在的问题
  • 学历认证取消申请还能再申请吗
  • 如何在河南省社会保障网上平台进行社保基数申报
  • 特定公共服务是什么意思
  • 2023年车辆购置税优惠政策有哪些
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设