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 ...
随机推荐
- Java package详解
Java引入包(package)机制,提供了类的多层命名空间,用于解决类的命名冲突.类文件管理等问题.Java允许将一组功能相关的类放在同一个package下,从而组成逻辑上的类库单元.如果希望把一个 ...
- GridControl Find/Clear 添加图标
public static void ControlFind(GridControl grid) { FindControl fControl = null; foreach (Control ite ...
- 深入浅出ES6(十):集合
作者 Jason Orendorff github主页 https://github.com/jorendorff 前段时间,官方名为“ECMA-262,第六版,ECMAScript 2015语言 ...
- proxool
配置database.xml <!--数据源 读写 --> <bean id="dataSourceRW" class="com.elong.ihote ...
- java集合之ArrayList的实现原理
1. ArrayList概述: ArrayList是List接口的可变数组的实现.实现了所有可选列表操作,并允许包括 null 在内的所有元素.除了实现 List 接口外,此类还提供一些方法来操作内部 ...
- POJ 3034 Whac-a-Mole(DP)
题目链接 题意 : 在一个二维直角坐标系中,有n×n个洞,每个洞的坐标为(x,y), 0 ≤ x, y < n,给你一把锤子可以打到地鼠,最开始的时候,你可以把锤子放在任何地方,如果你上一秒在( ...
- BZOJ 1877: [SDOI2009]晨跑 费用流
1877: [SDOI2009]晨跑 Description Elaxia最近迷恋上了空手道,他为自己设定了一套健身计划,比如俯卧撑.仰卧起坐等 等,不过到目前为止,他坚持下来的只有晨跑. 现在给出一 ...
- linux下top命令查看cpu占用情况
可以通过 top 命令来查看 CPU 使用状况.运行 top 命令后,CPU 使用状态会以全屏的方式显示,并且会处在对话的模式 -- 用基于 top 的命令,可以控制显示方式等等.退出 top 的命令 ...
- 本地替换文件读取MYSQL密码
Mysql 的密码默认是存储在/data/mysql/下面的三个文件中:user.MYD,user.frm,user.MYI 先把这三个文件下载到本地,然后替换本地的这三个文件 使用net stop ...
- Linux SHELL脚本
在Linux系统中,虽然有各种各样的图形化接口工具,但是sell仍然是一个非常灵活的工具.Shell不仅仅是命令的收集,而且是一门非常棒的编程语言.可以通过使用shell使大量的任务自动化,shell ...