Sphinx 2.2.6 window下安装全过程 未完 持续标记~~~~
由于在win8.1下安装 选的这个版本
Win64 binaries w/MySQL+PgSQL+libstemmer+id64 support | 2.2.6-release | 7.3M |
下载页面
http://sphinxsearch.com/downloads/release/
1.编辑配置文件
下载完 解压 到其中一个目录下
首先配置sphinx 配置文件 解压后sphinx目录下有个sphinx.conf.in 复制到bin目录下 并改名 sphinx.conf
配置如下 需要改的几个参数 稍微整理下 在发出
2.安装步骤
2.1 安装服务 启动守护进程
D:\www\Sphinx\bin>searchd --install --config D:\www\Sphinx\bin\sphinx.conf --servicename Sphinx
Sphinx 2.2.6-id64-release (r4843)
Copyright (c) 2001-2014, Andrew Aksyonoff
Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com)
Installing service...
Service 'Sphinx' installed successfully.
2.2 建立索引
D:\www\Sphinx\bin>indexer.exe --all
Sphinx 2.2.6-id64-release (r4843)
Copyright (c) 2001-2014, Andrew Aksyonoff
Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file './sphinx.conf'...
indexing index 'test1'...
collected 3 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 3 docs, 173 bytes
total 0.161 sec, 1073 bytes/sec, 18.61 docs/sec
indexing index 'test1stemmed'...
collected 3 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 3 docs, 173 bytes
total 0.061 sec, 2824 bytes/sec, 48.98 docs/sec
skipping non-plain index 'rt'...
total 6 reads, 0.000 sec, 0.1 kb/call avg, 0.0 msec/call avg
total 24 writes, 0.001 sec, 0.1 kb/call avg, 0.0 msec/call avg
2.3 开启服务
D:\www\Sphinx\bin>net start Sphinx
Sphinx 服务正在启动 .
Sphinx 服务已经启动成功。
20160828停止Sphinx服务 net stop Sphinx
C:\Windows\System32\cmd.exe 右键管理员权限执行
PS:按照顺序才是正确的
3.测试搜索
用的官方API事例调用的 不过有些问题 我把现在改的先发上来参考 还有些没弄明白
<?php
require ( "sphinxapi.php" );
$cl = new SphinxClient ();
$q = "模型";
$sql = "";
$mode = SPH_MATCH_ALL;
$host = "127.0.0.1";
$port = 9312;
$index = "*";
$groupby = "";
$groupsort = "@group desc";
$filter = "id";
$filtervals = array();
$distinct = "";
$sortby = "";
$sortexpr = "";
$limit = 20;
$ranker = SPH_RANK_PROXIMITY_BM25;
$select = ""; $cl->SetServer ( $host, $port );
$cl->SetConnectTimeout ( 1 ); $cl->SetArrayResult ( true ); $cl->SetRankingMode ( $ranker );
$res = $cl->Query ( $q, $index );
var_dump($res); if ( $res===false )
{
print "Query failed: " . $cl->GetLastError() . ".\n"; } else
{
if ( is_array($res["matches"]) )
{
$n = 1;
print "Matches:\n"; foreach ( $res["matches"] as $docinfo )
{
print "$n. id=$docinfo[id], weight=$docinfo[weight]";
print "\n"; foreach ( $res["attrs"] as $attrname => $attrtype )
{ $value = $docinfo["attrs"][$attrname]; if ( $attrtype==SPH_ATTR_MULTI || $attrtype==SPH_ATTR_MULTI64 )
{ $value = "(" . join ( ",", $value ) .")"; } else
{
if ( $attrtype==SPH_ATTR_TIMESTAMP )
$value = date ( "Y-m-d H:i:s", $value ); }
print ", $attrname=$value";
}
print "\n";
$n++;
}
} }
?>
搜索得到的结果是这样的
array(10) {
["error"]=>
string(0) ""
["warning"]=>
string(0) ""
["status"]=>
int(0)
["fields"]=>
array(8) {
[0]=>
string(8) "pictitle"
[1]=>
string(10) "picsubhead"
[2]=>
string(11) "piccategroy"
[3]=>
string(6) "pictag"
[4]=>
string(8) "picalbum"
[5]=>
string(9) "picauthor"
[6]=>
string(14) "picdescription"
[7]=>
string(8) "picmusic"
}
["attrs"]=>
array(7) {
["pictitle"]=>
int(7)
["picposttime"]=>
int(2)
["picsubhead"]=>
int(7)
["piccategroy"]=>
int(7)
["pictag"]=>
int(7)
["picdescription"]=>
int(7)
["picmusic"]=>
int(7)
}
["matches"]=>
array(1) {
[0]=>
array(3) {
["id"]=>
int(11)
["weight"]=>
string(4) "2680"
["attrs"]=>
array(7) {
["pictitle"]=>
string(7) "test111"
["picposttime"]=>
string(10) "1417853738"
["picsubhead"]=>
string(8) "fubiaoti"
["piccategroy"]=>
string(6) "模型"
["pictag"]=>
string(8) "zidingyi"
["picdescription"]=>
string(7) "picture"
["picmusic"]=>
string(20) "http://www.baidu.com"
}
}
}
["total"]=>
string(1) "1"
["total_found"]=>
string(1) "1"
["time"]=>
string(5) "0.000"
["words"]=>
array(2) {
["模"]=>
array(2) {
["docs"]=>
string(1) "2"
["hits"]=>
string(1) "2"
}
["型"]=>
array(2) {
["docs"]=>
string(1) "2"
["hits"]=>
string(1) "2"
}
}
}
Matches:
1. id=11, weight=2680
, pictitle=test111, picposttime=2014-12-06 16:15:38, picsubhead=fubiaoti, piccategroy=模型, pictag=zidingyi, picdescription=picture, picmusic=http://www.baidu.com
中文词典这些属性设置已经移除charset_dictpath 剩下的 等我研究好了 继续发布
在版本升级中 重点的东西提下
在2.2.1-beta版本下
官方推荐使用 SphinxQL
SphinxAPI and Sphinx SE以后将会被移除
在 2.2.2-beta版本中
移除了CLI search 以前版本的 search 命名不可用 bin目录下也没有search.exe
反对使用SetMatchMode() API
移除了charset_type and mssql_unicod设置 只支持UTF-8编码
PS: 2.2.6 默认开始了
listen = 9306:mysql41 启用了SphinxQL 并且ID默认都是64位
Sphinx 2.2.6 window下安装全过程 未完 持续标记~~~~的更多相关文章
- window下安装 node ,并搭建 vue 项目
uname -a 命令查看到我的Linux系统位数是64位(备注:x86_64表示64位系统, i686 i386表示32位系统) window下安装node 1.在官网上选择对应的位数的msi安装 ...
- window下安装cross-env解决NODE_ENV ts-node 不是内部或外部命令,也不是可运行的程序 或批处理文件 问题
window下安装cross-env解决NODE_ENV ts-node 不是内部或外部命令,也不是可运行的程序 或批处理文件 问题 在git bash上启动无法进行调试,采用cross-env后可以 ...
- Window 下安装
Window 下安装 下载地址:https://github.com/MSOpenTech/redis/releases Redis 支持 32 位和 64 位.这个需要根据你系统平台的实际情况选择, ...
- Window 下安装 Redis
Redis 是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据库. 一.Window 下安装 redis https://github.com/MicrosoftArchive/r ...
- window下安装redis报错: creating server tcp listening socket 127.0.0.1:6379: bind No error
window下安装redis报错: creating server tcp listening socket 127.0.0.1:6379: bind No error 解决: 如果没有配置环境,在安 ...
- window下安装rsyncServer
window下安装rsyncServer---------------------------------1. 解压cwRsyncServer_4.0.5_Installer.zip,安装. 2. 复 ...
- nginx(Window下安装 & 配置文件参数说明 & 实例)
一.为什么需要对Tomcat服务器做负载均衡: Tomcat服务器作为一个Web服务器,其并发数在300-500之间,如果有超过500的并发数便会出现Tomcat不能响应新的请求的情况,严重影响网站 ...
- window下安装php7的memcache扩展
安装memcache:http://www.runoob.com/memcached/memcached-connection.html1.4.4 c:\memcached\memcached.exe ...
- window下安装composer步骤(linux待研究)
window下安装composer步骤--注意(安装完之后需要重启电脑才能生效) 转发:https://blog.csdn.net/wengedexiaozao/article/details/798 ...
随机推荐
- ps还能用脚本切片?
最近在慕课网上看有关于ps切图的视频,发现ps 切片的水还挺深的.这相当于我的一篇学习笔记吧.对于ps的基本切图我觉得对于前端人员来说就是a piece of cake.但是对于ps的精准切图,我不知 ...
- 【HDU 4614】Vases and Flowers(线段树区间更新懒惰标记)
题目0到n-1的花瓶,操作1在下标a开始插b朵花,输出始末下标.操作2清空[a,b]的花瓶,求清除的花的数量.线段树懒惰标记来更新区间.操作1,先查询0到a-1有num个空瓶子,然后用线段树的性质,或 ...
- iOS 蓝牙开发(二)iOS 连接外设的代码实现(转)
转载自:http://www.cocoachina.com/ios/20150917/13456.html 原文作者:刘彦玮 上一篇文章介 绍了蓝牙的技术知识,这里我们具体说明一下中心模式的应用场景. ...
- MVP模式
一.软件设计鼻祖MVC 1.1.MVC 第一次听到MVC这个名词是在C#中,相信对于MVC大家都已经很熟悉了,作为一种软件设计模式,MVC这个概念已经诞生好多年了. 如果你已经开发一段时间的iOS应用 ...
- 【BZOJ-4568】幸运数字 树链剖分 + 线性基合并
4568: [Scoi2016]幸运数字 Time Limit: 60 Sec Memory Limit: 256 MBSubmit: 238 Solved: 113[Submit][Status ...
- 【BZOJ-2115】Xor 线性基 + DFS
2115: [Wc2011] Xor Time Limit: 10 Sec Memory Limit: 259 MBSubmit: 2142 Solved: 893[Submit][Status] ...
- linux中授予普通用户root权限
本来也更改了/etc/passwd,改成0:0淡水其他地方又出问题,所以又改回来了. chown -R hxsyl .Spark_Relvant 当前在hadoop-2.6.4下,‘.’表示当前目录.
- 【poj2122】 Optimal Milking
http://poj.org/problem?id=2112 (题目链接) 题意 有K个能挤M头奶牛的挤奶机和C头奶牛,告诉一些挤奶机和奶牛间距离,求最优分配方案使最大距离最小. Solution 先 ...
- 【bzoj2809】 Apio2012—dispatching
http://www.lydsy.com/JudgeOnline/problem.php?id=2809 (题目链接) 题意 给出一棵树,每个节点有两个权值${c}$,${L}$,分别代表花费和领导力 ...
- tyvj2018 小猫爬山
之前做过一道题"破锣摇滚乐队",把猫都编了号,每辆车只能装一些编号递增的猫,而且前一辆车的猫编号都比后一辆车小.那道题的DP状态是:f[i][j]表示装了前i只猫,使用了j辆车时第 ...