安装与启动

  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. swift学习网站

    http://letsswift.com/category/swiftguide/http://www.imooc.com/course/list?is_easy=3&c=ioshttp:// ...

  2. mysql 存储过程事务支持回滚

    如图查看表的属性: InnoDB 支持事务. MyISAM 不支持事务,不过性能更优越.

  3. ***PHP preg_match正则表达式的使用

    第一,让我们看看两个特别的字符:‘^’和‘$’他们是分别用来匹配字符串的开始和结束,以下分别举例说明 : "^The": 匹配以 "The"开头的字符串; &q ...

  4. DB2对年份的处理Year()

    public DataSet GetCustomerAllocListByQC(CustomerAllocQueryDataContract aQC) { StringBuilder sql = ne ...

  5. node.js的npm详解

    一.什么是npm呢 npm(Node Package Manager,node包管理器)是node的包管理器,他允许开发人员在node.js应用程序中创建,共享并重用模块.模块就是可以在不同的项目中重 ...

  6. 浅谈mysql中varchar(m)与char(n)的区别与联系

    mysql建表长度的限制 在mysql建表时,出现以下报错信息: 错误一:行大小过大,所使用的表这种类型的最大的行大小,不算BLOB类型,是65535.(这是我翻译的)    原因是MySQL在建表的 ...

  7. proc插入数据到数据库

    #include<stdio.h>EXEC SQL INCLUDE SQLCA; void insert (char password_[6],char id_[20],int balan ...

  8. 当C++学到第20天的时候我崩溃了(找回刚开始的激情)

    首先声明,我是个使用多语言(ASM/C/C++/Java/Perl)的人,主要使用C++和Java所以我认为我的意见还算中肯.那些否定C++的人,你们是否了解————Borland鼓吹Delphi如何 ...

  9. lintcode:Wiggle Sort

    Wiggle Sort Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= ...

  10. mysql+heartbeat+DRBD+LVS集群