由于在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. 02python算法-递推

    递推 1什么是递推?:根据已有节点的值,以及规律推出之后节点的值 2为什么要用递推:简单的解决有规矩事件 3怎么用?: 我们举个经典的例子: 如果1对兔子每月能生1对小兔子,而每对小兔在它出生后的第3 ...

  2. lucene-查询query->QueryParser

    对于搜索引擎(比如Google和百度)来讲,很多情况下只需要用户在输入框内输入所需查询的内容,然后再单击“搜索”就可以了,其余的事情全部交给搜索引擎去处理,最后搜索引擎会把检索到的结果显示出来.那么搜 ...

  3. C# 后台json转换成时间格式

    1传入json 字符进行转换        public DateTime ConvertTime(string milliTime)        {            long timeTri ...

  4. Web前端性能优化教程09:图像和Cookie优化

    本文是Web前端性能优化系列文章中的第九篇,主要讲述内容:图像和Cookie优化.完整教程可查看:  一. 图像优化 图像基础知识 gif: 适用于动画效果,例如提示的滚动条图案 jpg: 是一种使用 ...

  5. Core Foundation框架

    转载自:http://blog.csdn.net/weiwangchao_/article/details/7744972 Core Foundation框架 (CoreFoundation.fram ...

  6. Java非静态内部类中为什么不能有静态变量却可以有常量?

    如:public class InnerClassDemo{ int x; class A{ static int a = 0;//这样写是不合法的. static final int b=0;//这 ...

  7. c#读取excel

    Provider根据实际EXCEL的版本来设置,推荐使用ACE接口来读取.需要Access database Engine. 注意修改注册表以下两项的值为0.否则导入EXCEL当单元格内字符长度超过2 ...

  8. VI,CI,UI

    一.VI VI全称Visual Identity, 即企业VI视觉设计,通译为视觉识别系统.是将CI的非可视内容转化为静态的视觉识别符号.设计到位.实施科学的视觉识别系统,是传播企业经营理念.建立企业 ...

  9. BZOJ4423 [AMPPZ2013]Bytehattan

    本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000作者博客:http://www.cnblogs.com/ljh2000-jump/转 ...

  10. iOS “智慧气象”APP中用到的第三方框架汇总

    “智慧气象”是我最近在公司接手的项目,已经完成最新版本的更新并上架,在此分享下其中用到的第三方框架的使用. 应用地址:APP商店搜索“智慧气象” MJRefresh(下拉刷新)业界知名下拉刷新框架就不 ...