由于在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. 【poj1019】 Number Sequence

    http://poj.org/problem?id=1019 (题目链接) 题意 给出一个数:1 12 123 1234 12345 123456 1234567 12345678 123456789 ...

  2. bzoj3295: [Cqoi2011]动态逆序对(树套树)

    #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #i ...

  3. oracle的resetlogs机制浅析(转)

    文章转自:http://blog.csdn.net/wyzxg/article/details/5869543 alter database open resetlogs 这个命令我想大家都很熟悉了, ...

  4. poj1811 数论

    题意:判断一个数是否是质数+分解质因数 sol:模板题 分解质因数用xudyh模板,注意factor返回的是无序的,factorG返回是从小到大的顺序(包括了1) 判断质数用kuangbin随机化模板 ...

  5. UVa 673 Parentheses Balance

    一个匹配左右括号的问题 /*UVa 673 Parentheses Balance*/ #include<iostream> #include<algorithm> #incl ...

  6. GPU keylogger && GPU Based rootkit(Jellyfish rootkit)

    catalog . OpenCL . Linux DMA(Direct Memory Access) . GPU rootkit PoC by Team Jellyfish . GPU keylogg ...

  7. 最小生成树问题---Prim算法与Kruskal算法实现(MATLAB语言实现)

    2015-12-17晚,复习,甚是无聊,阅<复杂网络算法与应用>一书,得知最小生成树问题(Minimum spanning tree)问题.记之. 何为树:连通且不含圈的图称为树. 图T= ...

  8. jpa注解

    http://www.oracle.com/technetwork/cn/middleware/ias/toplink-jpa-annotations-100895-zhs.html#ManyToOn ...

  9. AngularJs filter 过滤器

    Filter Ng里的过滤器. currency:把一个数字格式化成货币模式(如$1,234.56).当没有提供任何货币符号时,默认使用当前区域的符号. 使用: HTML:{{ currency_ex ...

  10. Struts学习总结-04 上传文件

    1. upload.jsp <%@ page language="java" import="java.util.*" pageEncoding=&quo ...