php语言 百分网手机站

php启用sphinx全文搜索的方法(3)

时间:2020-08-08 15:14:59 php语言 我要投稿

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全文搜索的方法】相关文章:

php算法学习之宽度优先搜索09-28

PHP伪静态的方法09-28

高效学习PHP的方法09-04

PHP获取星期的方法09-02

搜索框设计和布局的方法10-04

php变量定义方法09-14

PHP 表单验证方法09-12

php学习入门方法09-09

PHP自学方法09-08

tp搜索时首页分页和搜索页保持条件分页的方法08-16