sphinx 全文搜索 软件 工具 的安装使用
来源:互联网 发布:联通网络电视破解软件 编辑:程序博客网 时间:2024/05/22 03:20
我使用的环境是windows,过程参考了这篇文章:http://www.kaiyuanba.cn/html/1/131/140/7577.htm
1.首先是在官方<http://sphinxsearch.com/>下载了此文件:sphinx-2.0.6-release-win64.zip
2.解压之后在bin同级目录建立log和data目录,然后将根目录的example.sql在mysql的localhost服务器的test数据库上执行。
3.
Install the searchd
system as a Windows service:
参考这种方式注册服务:C:\Sphinx\bin> C:\Sphinx\bin\searchd --install --config C:\Sphinx\sphinx.conf.in --servicename SphinxSearch
(这一步来自于解压包里的doc手册)
4.之后将根目录的sphinx.conf.in拷贝到bin目录下并rename为sphinx.conf,并将里面的数据库配置,和index test1和searchd进行相关配置,将其中的@CONFDIR@都替换成你的根目录,例如C:\Sphinx\
5.然后要启动守护进程searchd:
可以看到searchd监听了9312端口,并且里面已经将test1索引预先缓存了,其他的一些缓存失败我暂时没搭理
6.在解压包下面的api目录下的sphinxapi.php拿来,放到www目录下,然后编写:
<?php
require "sphinxapi.php";
$s = new SphinxClient();
$s->SetServer('localhost',9312);
$result = $s->Query('test','test1');
print_r($result);
?>
输出结果为:
Array( [error] => [warning] => [status] => 0 [fields] => Array ( [0] => title [1] => content ) [attrs] => Array ( [group_id] => 1 [date_added] => 2 ) [matches] => Array ( [1] => Array ( [weight] => 2 [attrs] => Array ( [group_id] => 1 [date_added] => 1359542960 ) ) [2] => Array ( [weight] => 2 [attrs] => Array ( [group_id] => 1 [date_added] => 1359542960 ) ) [4] => Array ( [weight] => 1 [attrs] => Array ( [group_id] => 2 [date_added] => 1359542960 ) ) ) [total] => 3 [total_found] => 3 [time] => 0.000 [words] => Array ( [test] => Array ( [docs] => 3 [hits] => 5 ) ))
结束。
- sphinx 全文搜索 软件 工具 的安装使用
- sphinx+scws 全文检索使用之在没安装MySQL的服务器上安装Sphinx
- sphinx全文搜索
- sphinx全文检索工具
- Sphinx+Mysql+中文分词安装-实现中文全文搜索
- Sphinx-for-chinese (中文全文搜索)安装步骤
- Sphinx+Mysql+中文分词安装-实现中文全文搜索
- MySQL+Sphinx实现全文搜索
- MySQL+Sphinx实现全文搜索
- Sphinx全文索引搜索常见的一些错误处理收集
- Sphinx全文索引搜索常见的一些错误处理收集
- sphinx的安装使用
- Sphinx在windows下安装使用[支持中文全文检索]
- Sphinx在windows下安装使用[支持中文全文检索]
- Sphinx在windows下安装使用[支持中文全文检索]
- Sphinx在windows下安装使用[支持中文全文检索]
- sphinx+scws 全文检索使用之 安装配置篇
- DedeCMS V5.7全文检索sphinx安装使用教程
- java 编程中使用Pattern+Matcher 从一个大字符串中提取特定文字
- poll函數
- 织梦(dedecms)仿站教程第第十四讲—特定栏目图片调用
- wince6.0 PB工程编译选项简介
- 用事物变式( transaction variants )隐藏sap便准程序的field
- sphinx 全文搜索 软件 工具 的安装使用
- [Axure]原型设计软件:Axure RP简单介绍与基础入门学习目录
- Remote Access To MySQL
- Alax技术实现的基本原理——XMLHttpRequest对象的使用
- UVa 10033 - Interpreter
- zigbee学习笔记3----cc2530 外部中断实验
- 格式化相关知识
- BIT 1031 Binary Tree Traversals
- cocos2d-x初学笔记04:切换场景Scene