xunsearch迅搜体验
安装与启动
http://www.xunsearch.com/doc/php/guide/start.installation
编写配置文件
http://www.xunsearch.com/doc/php/guide/ini.guide
http://www.xunsearch.com/doc/php/guide/ini.first
导入的数据需要与配置文件对应,注意索引字段,最好有一个both索引,后面测试都是self索引会导致不模糊查找没有数据
project.name = magicbox
server.index = 192.168.1.168:
server.search = 192.168.1.168: [id]
type = id
tokenizer = full [name]
type = title
index = both [platform]
index = self
tokenizer = full [class]
index = self
tokenizer = full [is_act]
index = self
tokenizer = full [is_avg]
index = self
tokenizer = full [is_mmorpg]
index = self
tokenizer = full [is_stg]
index = self
tokenizer = full [is_rpg]
index = self
tokenizer = full [is_mag]
index = self
tokenizer = full [is_spg]
index = self
tokenizer = full [is_rac]
index = self
tokenizer = full [is_mug]
index = self
tokenizer = full [is_puz]
index = self
tokenizer = full [is_tab]
index = self
tokenizer = full [is_td]
index = self
tokenizer = full [is_gsg]
index = self
tokenizer = full [is_etc]
index = self
tokenizer = full [type]
index = self
tokenizer = full [mark] [icon] [dl_url] [auth_status]
index = self
tokenizer = full [dl_count_px]
type = numeric [dl_count] [star_px]
type = numeric [star] [pub_time_px]
type = numeric [pub_time] [comment_id]
导入数据使用sdk
php Indexer.php --rebuild --source=mysql://chaohaowan:123456@192.168.1.168/magicbox --sql="select *,UNIX_TIMESTAMP(pub_time) as pub_time_px,star as star_px,dl_count as dl_count_px from mb_resource" --project=magicbox
php Indexer.php --project=magicbox --info 查看数据导入与否
php Indexer.php --project=magicbox --flush 强制刷入数据
php Indexer.php --project=magicbox --clean 清空索引数据
以上就是建立索引的主要方法
查询
php Query.php --project=magicbox -q 测试
主要的api调用
http://www.xunsearch.com/doc/php/guide/search.query
$this -> search -> setAutoSynonyms();
//$this -> search -> setFuzzy();
//$wd = "$wd";
$this -> search -> setQuery($wd);
//$this -> search -> setQuery('name:武士 僵尸 大战');
$this -> search -> addRange('auth_status',,);
//header("Content-Type: text/html;Charset=UTF8;");
//$this -> search -> addRange('type',3,3);
//$this -> search -> addRange('platform',2,2);
//$this -> search -> setSort('dl_count_px',false);
// $this -> search -> setLimit(3, 0);
// $querty = $this -> search -> getQuery();
//$dataA = $this -> search -> search();
// //$count = $this -> search -> getLastCount();
// var_dump($querty);
//$this -> search -> setSort('pub_time_px',false);
// $querty = $this -> search -> getQuery();
//var_dump($dataA);exit;
更新索引数据,删除等
http://www.xunsearch.com/doc/php/guide/index.update
分词
http://www.xunsearch.com/doc/php/guide/special.scws
xunsearch迅搜体验的更多相关文章
- xunsearch 迅搜初探
2014年1月2日 19:34:12 [root@localhost bin]# ./php /usr/local/lamp/xunsearch/sdk/php/util/Quest.php demo ...
- Xunsearch迅搜(基于 xapian+scws 的开源中文搜索引擎)安装与简单使用
今天鼓捣了xunsearch,感觉官方指南写得挺详细,于是按照指南一步一步走,但是感觉越看越凌乱,像看API一样,新手看得特费劲,网上也少有新手教程,于是略过今天的歪路,记录一下我的安装步骤. Xun ...
- 迅搜sdk试用
1. sdk支持PHP 2. 针对mysql的某个库的某个表??进行索引,简单的说就是一个project,需要对应一个配置文件: 3. 分索引服务与搜索服务两个,另带中文分词功能:索引数据会有演示,但 ...
- xunsearch全文检索初体验
目录 测试添加数据 测试搜索 简单搜索 稍微复杂的搜索 搜索建议 测试添加数据 ./Indexer.php --source=csv --clean demo 清空现有索引数据 ... 初始化数据源 ...
- /usr/bin/env: php: No such file or directory 【xunsearch demo项目体验】【已解决】
出现这个问题的原因是/usr/local/bin 或 /usr/bin 下面没有php可执行文件 解决办法: 建立一条硬链接 ln /path/to/bin/php /usr/local/bin/p ...
- 中文全文检索讯搜xunsearch安装
Xunsearch (迅搜)是一套免费开源的专业中文全文检索解决方案,简单易用而且 功能强大.性能卓越能轻松处理海量数据的全文检索.它包含后端索引.搜索服务程序和前端 脚本语言编写的开发工具包(称之为 ...
- xunsearch安装与卸载
刚接触xunsearch(迅搜)的时候,我是排斥的.排斥的原因不是因为害怕学习新技术(其实我是对心技术很感兴趣),而是因为:一方面xunsearch是国人开发的,对于国人写的开源产品,我不是太感兴趣( ...
- 【xunsearch】笔记
1.添加索引 $ cd /usr/local/xunsearch/sdk/php/ $ util/Indexer.php --rebuild --source=mysql://数据库用户名:数据库密码 ...
- PHP+mysql数据库开发搜索功能:中英文分词+全文检索(MySQL全文检索+中文分词(SCWS))
PHP+mysql数据库开发类似百度的搜索功能:中英文分词+全文检索 中文分词: a) robbe PHP中文分词扩展: http://www.boyunjian.com/v/softd/robb ...
随机推荐
- poj 1733(带权并查集+离散化)
题目链接:http://poj.org/problem?id=1733 思路:这题一看就想到要用并查集做了,不过一看数据这么大,感觉有点棘手,其实,我们仔细一想可以发现,我们需要记录的是出现过的节点到 ...
- JS之类型转换
一.显示类型转换 1.Boolean() (1).undefined/null/‘’ ==> false (2).任何对象(包括例如var obj = {} ) ==> true ( ...
- shell基础(一)
Shell本身是一个用C语言编写的程序,它是用户使用Unix/Linux的桥梁,用户的大部分工作都是通过Shell完成的.Shell既是一种命令语言,又是一种程序设计语言.作为命令语言,它交互式地解释 ...
- grep sed
grep -q angeltoto "a.txt"&& (sed -i '/angeltoto/c\'"angeltoto=BUPT" &quo ...
- 创建DB2数据库时报错--SQL1052N 数据库路径不存在(Windows)(转载)
用DB2 v9.7新建数据库的时候,默认路径为:D:\ 把缺省路径“写的是D:\XXX(此目录存在),新建时提示如下:SQL1052N 数据库路径 "D:\XXX" 不存在.如下: ...
- lintcode:交换链表当中两个节点
题目 给你一个链表以及两个权值v1和v2,交换链表中权值为v1和v2的这两个节点.保证链表中节点权值各不相同,如果没有找到对应节点,那么什么也不用做. 注意事项 你需要交换两个节点而不是改变节点的权值 ...
- JVM垃圾回收机制总结(4) :新一代的垃圾回收算法
垃圾回收的瓶颈 传统分代垃圾回收方式,已经在一定程度上把垃圾回收给应用带来的负担降到了最小,把应用的吞吐量推到了一个极限.但是他无法解决的一个问题,就是Full GC所带来的应用暂停.在一些对实时性要 ...
- Android应用截图和SurfaceView截图问题总结
最近在做android截图应用的过程遇到很多问题,接触了好些截图方法,但是还是不能实现SufaceView截图功能.今天就把我尝试过的方法总结下,希望把我惨痛的经历写出来后能够帮助到要做此 ...
- 微信jssdk uploadImage 巨坑
//解决IOS无法上传的坑 if (localId.indexOf("wxlocalresource") != -1) { localId = localId.replace(&q ...
- 计算机术语install和setup的区别
作为安装程序的Setup文件是软件的开发者专门为其软件设计的.exe文件,是当前最为盛行的安装程序.在运行该Setup文件进行软件安装时,Setup除了进行复制.改名.解压和目录维护等基本安装工作外, ...