安装与启动

  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迅搜体验的更多相关文章

  1. xunsearch 迅搜初探

    2014年1月2日 19:34:12 [root@localhost bin]# ./php /usr/local/lamp/xunsearch/sdk/php/util/Quest.php demo ...

  2. Xunsearch迅搜(基于 xapian+scws 的开源中文搜索引擎)安装与简单使用

    今天鼓捣了xunsearch,感觉官方指南写得挺详细,于是按照指南一步一步走,但是感觉越看越凌乱,像看API一样,新手看得特费劲,网上也少有新手教程,于是略过今天的歪路,记录一下我的安装步骤. Xun ...

  3. 迅搜sdk试用

    1. sdk支持PHP 2. 针对mysql的某个库的某个表??进行索引,简单的说就是一个project,需要对应一个配置文件: 3. 分索引服务与搜索服务两个,另带中文分词功能:索引数据会有演示,但 ...

  4. xunsearch全文检索初体验

    目录 测试添加数据 测试搜索 简单搜索 稍微复杂的搜索 搜索建议 测试添加数据 ./Indexer.php --source=csv --clean demo 清空现有索引数据 ... 初始化数据源 ...

  5. /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 ...

  6. 中文全文检索讯搜xunsearch安装

    Xunsearch (迅搜)是一套免费开源的专业中文全文检索解决方案,简单易用而且 功能强大.性能卓越能轻松处理海量数据的全文检索.它包含后端索引.搜索服务程序和前端 脚本语言编写的开发工具包(称之为 ...

  7. xunsearch安装与卸载

    刚接触xunsearch(迅搜)的时候,我是排斥的.排斥的原因不是因为害怕学习新技术(其实我是对心技术很感兴趣),而是因为:一方面xunsearch是国人开发的,对于国人写的开源产品,我不是太感兴趣( ...

  8. 【xunsearch】笔记

    1.添加索引 $ cd /usr/local/xunsearch/sdk/php/ $ util/Indexer.php --rebuild --source=mysql://数据库用户名:数据库密码 ...

  9. PHP+mysql数据库开发搜索功能:中英文分词+全文检索(MySQL全文检索+中文分词(SCWS))

    PHP+mysql数据库开发类似百度的搜索功能:中英文分词+全文检索 中文分词: a)   robbe PHP中文分词扩展: http://www.boyunjian.com/v/softd/robb ...

随机推荐

  1. Leetcode: strStr()

    Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle ...

  2. 使用 Struts 2 开发 RESTful 服务

    REST 简介 REST 是英文 Representational State Transfer 的缩写,这个术语由 Roy Thomas Fielding 博士在他的论文<Architectu ...

  3. MYSQL - ORDER BY & LIMIT

    http://stackoverflow.com/questions/4708708/mysql-order-by-limit

  4. (2)jni编程学习笔记

    先说说NDK和jni的关系吧,这两个看起来挺容易搞混的 我到网上也查了一些资料: java的jni提供了一个调用c语言函数的接口,其实就是一个java函数,这个函数没有任何内容,这个函数调用时直接进入 ...

  5. java编译错误:varargs 方法的非 varargs 调用

    转自:http://www.blogjava.net/ideame/archive/2007/03/23/105849.html 警告: 最后一个参数使用了不准确的变量类型的 varargs 方法的非 ...

  6. SSH开发实践part3:hibernate继承映射

    0 大家好.上次讲了关于hibernate中双向1-N的映射配置,可以参考:http://www.cnblogs.com/souvenir/p/3784510.html 实际项目中,对象间的关系比较复 ...

  7. iOS开发之都兴忱小结

    1.NSArray/NSDictionary ------> strong temp和self.arr是同一地址. 2.NSArray/NSDictionary ------->copy ...

  8. Linux Command Line 解析

    Linux Command Line 解析 0 处理模型 Linux kernel的启动包括很多组件的初始化和相关配置,这些配置参数一般是通过command line进行配置的.在进行后续分析之前,先 ...

  9. Haproxy安装及配置

    1.安装 # wget http://haproxy.1wt.eu/download/1.3/src/haproxy-1.3.20.tar.gz # tar zcvf haproxy-1.3.20.t ...

  10. php ++a和a++

    <?php$a=$b=5;$a+$b=$a++-++$b;echo $b;?> 输出-1