由于在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下安装全过程 未完 持续标记~~~~的更多相关文章

  1. window下安装 node ,并搭建 vue 项目

    uname -a  命令查看到我的Linux系统位数是64位(备注:x86_64表示64位系统, i686 i386表示32位系统) window下安装node 1.在官网上选择对应的位数的msi安装 ...

  2. window下安装cross-env解决NODE_ENV ts-node 不是内部或外部命令,也不是可运行的程序 或批处理文件 问题

    window下安装cross-env解决NODE_ENV ts-node 不是内部或外部命令,也不是可运行的程序 或批处理文件 问题 在git bash上启动无法进行调试,采用cross-env后可以 ...

  3. Window 下安装

    Window 下安装 下载地址:https://github.com/MSOpenTech/redis/releases Redis 支持 32 位和 64 位.这个需要根据你系统平台的实际情况选择, ...

  4. Window 下安装 Redis

    Redis 是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据库. 一.Window 下安装 redis https://github.com/MicrosoftArchive/r ...

  5. 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 解决: 如果没有配置环境,在安 ...

  6. window下安装rsyncServer

    window下安装rsyncServer---------------------------------1. 解压cwRsyncServer_4.0.5_Installer.zip,安装. 2. 复 ...

  7. nginx(Window下安装 & 配置文件参数说明 & 实例)

    一.为什么需要对Tomcat服务器做负载均衡:  Tomcat服务器作为一个Web服务器,其并发数在300-500之间,如果有超过500的并发数便会出现Tomcat不能响应新的请求的情况,严重影响网站 ...

  8. window下安装php7的memcache扩展

    安装memcache:http://www.runoob.com/memcached/memcached-connection.html1.4.4 c:\memcached\memcached.exe ...

  9. window下安装composer步骤(linux待研究)

    window下安装composer步骤--注意(安装完之后需要重启电脑才能生效) 转发:https://blog.csdn.net/wengedexiaozao/article/details/798 ...

随机推荐

  1. 详解Mac配置虚拟环境Virtualenv

    virtualenv 可以用来建立一个专属于项目的python环境,保持一个干净的环境.只需要通过命令创建一个虚拟环境,不用的时候通过命令退出,删除. 下面介绍一下安装方法: 安装 virtualen ...

  2. Hadoop实战第一篇

    前言:  都说现在是草根为尊的时代,近年来hadoop及spark技术在国内越来越流行.而且渐渐现成为企业的新宠.在DT时代全面来临之前,能提早接触大数据的技术必然能先人一步.本文作为Hadoop系列 ...

  3. bzoj4418&&bzoj4419&&bzoj4420:SHOI2013Day2题解

    这三题截止现在(2016.3.11)窝居然都是跑的最快的……可啪…… T1 bzoj4418 这题叫做扇形面积并,看到这个名字我就方了,因为我不会计算几何啊QAQ 一看题目,发现是傻逼题……(雾) 又 ...

  4. target file里面的每个string字段的双引号怎么去掉

    今天在做一个extract,把数据库里面的表经过一些过程,最终输入到flat file中. 但是最终的结果中,每个target file的string字段,含有双引号如下: NAME_ID    NA ...

  5. .net读写config appsetting

    读 this.txtOutPutPath.Text = ConfigurationManager.AppSettings["OutPutPath"]; this.txtFilter ...

  6. hdu5047 找规律+欧拉公式

    题意:在一个正方形内画n个M,求最多能分成多少个平面 sol:这种求划分成多少个平面的题第一反应肯定是欧拉公式: 二维平面上的欧拉公式:V+F-E=1 (V:Vertices,F:Faces,E:Ed ...

  7. QCustomPlot 使用整理

    QCustomPlot 是一个比较小的 QT 图表插件.使用时,我们在程序中写完相关调用的代码后,只需将 QCunstomPlot.cpp 和 QCustomPlot.h 两个文件加入工程,正常编译即 ...

  8. C语言用面向对象的思想写贪吃蛇

    大概一年前这时候,接触C语言一个月,那时候知之甚少,对面向对象只觉”可远观而不可亵玩“,而且会看到很多言论说C语言就是面向过程的语言,C++就是面向对象的语言.不过,不记得什么时候在网上看到过一篇博文 ...

  9. css优化

    >>.li设置了display:inline-block,会有空隙,可在父元素ul下设置font-size:0 >>.ie下不支持margin:0 auto; >> ...

  10. POJ 1236 Network of Schools(强连通分量/Tarjan缩点)

    传送门 Description A number of schools are connected to a computer network. Agreements have been develo ...