安装与启动

  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. Message,MessageQueue,Looper,Handler详解

    Message,MessageQueue,Looper,Handler详解   一.几个关键概念 1.MessageQueue:是一种数据结构,见名知义,就是一个消息队列,存放消息的地方.每一个线程最 ...

  2. sql server 存储过程,事务

    1.存储过程,事务 CREATE PROCEDURE Proc_ceshi @id int, ), @returnval int output AS BEGIN SET NOCOUNT ON; Set ...

  3. Linux下安装Scim-googlepinyin输入法和设置Sublime Text中文输入

    1.安装git sudo apt-get install git http://www.cnblogs.com/perseus/archive/2012/01/06/2314069.html 2.获取 ...

  4. (转)Android之ListView原理学习与优化总结

    转自: http://jishu.zol.com.cn/12893.html 在整理前几篇文章的时候有朋友提出写一下ListView的性能优化方面的东西,这个问题也是小马在面试过程中被别人问到的….. ...

  5. Codeforces Round #337 (Div. 2) C. Harmony Analysis 数学

    C. Harmony Analysis   The semester is already ending, so Danil made an effort and decided to visit a ...

  6. 浅谈Spark Kryo serialization

    原创文章,转载请注明: 转载自http://www.cnblogs.com/tovin/p/3833985.html 最近在使用spark开发过程中发现当数据量很大时,如果cache数据将消耗很多的内 ...

  7. springMVC找不到JS等文件

     应用springMVC时 JS等文件找不到错误 应用springMVC时如果配置URL映射时如下配置 <servlet>        <servlet-name>appSe ...

  8. iOS:弹出窗控制器:UIPopoverController

    弹出窗控制器:UIPopoverController 截图:   实质:就是将内容控制器包装成popoverController的形式,然后在模态出来,必须给定指向目标(target.frame). ...

  9. JSP下载txt 和 Excel两种文件

    JSP下载txt 和 Excel两种文件 jsp 下载txt文件和excel文件   jsp 下载txt文件和excel文件 最近做了个用jsp下载的页面 将代码贴出来 权作记录吧 1 下载txt文件 ...

  10. Control Flow ->> Containers

    Sequence Container: 它的作用就是可以把一组任务绑定起来成为一个整体,这样Sequence本身就是具有了任务(task)的特性,比如TransactionOption.如果需要把一组 ...