php sphinx 搜索,php启用sphinx全文搜索的方法

php启用sphinx全文搜索的方法

[0] => name

[1] => type

)

[attrs] => Array

(

[stock] => 1

)

[matches] => Array

(

[0] => Array

(

[id] => 8

[weight] => 1

[attrs] => Array

(

[stock] => 100

)

)

)

[total] => 1

[total_found] => 1

[time] => 0.018

[words] => Array

(

[名卡] => Array

(

[docs] => 1

[hits] => 1

)

)

)

Array

(

[error] =>

[warning] =>

[status] => 0

[fields] => Array

(

[0] => name

[1] => type

)

[attrs] => Array

(

[stock] => 1

)

[matches] => Array

(

[0] => Array

(

[id] => 8

[weight] => 1

[attrs] => Array

(

[stock] => 100

)

)

)

[total] => 1

[total_found] => 1

[time] => 0.018

[words] => Array

(

[名卡] => Array

(

[docs] => 1

[hits] => 1

)

)

)

完全没问题,搜索出来了,几个关键的操作:

[root@beihai365 /]# csft-searchd --stop 停止搜索守护

[root@beihai365 /]# csft-indexer --all 针对所有节点生成索引,你也可以针对某个节点生成索引比如:csft-indexer  xx

[root@beihai365 /]# csft-search App 搜索关键字 App,不过看下面信息没有搜到和没有命中任何的文档.

Coreseek Full Text Server 3.1

Copyright (c) 2006-2008 coreseek.com

using config file './csft.conf'...

1,

pt:1, 1;        index 'tmsgsindex': query 'App ': returned 0 matches of 0 total in 0.017 sec

words:

1. 'app': 0 documents, 0 hits

当大家在运行这些命令的时候发现,需要你自己手动的置顶 --config  sphinx.conf   配置文件的路径,很不方便,所以我干脆 ln -s 一个在 ./,这样不用每次都去敲入  --config.

希望本文所述对大家的php程序设计有所帮助。

【php启用sphinx全文搜索的方法】相关文章:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值