PHP头条
热点:

Sphinx在window下的初步安装和配置


  前几天在网上找安装sphinx的资料,没有找到很全面的,不是这走不通就是那不通,今天总算整出来了,整理一下。

  1.     windows  Win32 release binaries with MySQL support  D:/sphinx 

  2. D:/sphinx/  data   log D:/sphinx/sphinx.conf.in  D:/sphinx/bin/sphinx.conf  

  3.配置在这就不多说了,网上很多,而且这一步基本都是对的

  4.  sql  D:/sphinx/example.sql   (这应该不难)

  5.

  D:/sphinx/bin>indexer.exe test1 (  :test1 索引名,  sphinx.conf  index test1(),关于这个,我刚开始看到的是在这运行indexer.exe -all,但是会报错,后来看到这个indexer.exe test1,运行,成功 )

  

  6. ’test’ 

  D:/sphinx/bin>search.exe test

  

  

  7.

 test  documents 

  UPDATE `test`.`documents` SET `title` = ‘  ’, `content` = ‘this is my test document number two  ’ WHERE `documents`.`id` = 2;

  D:/sphinx/bin>indexer.exe test1

    

  D:/sphinx/bin>search.exe  

  

windows  gbk 。我们可以用程序试试,在D:/sphinx/api  foo.php utf-8 

  

 Sphinx searchd 

  D:/sphinx/bin>searchd.exe  

  

  

 

 PHP ):

 http://www.test.com/sphinx/api/foo.php (  )

  页面中就会输出找到的信息了,其中一部分是:

  

  看到了吗,它将“中文”分成2个字了,呵呵,这是因为我们还没用中文分词,它只能一个一个字的处理了,关于中文分词和其它高级配置以后再讲吧。

  到此sphinx基本就可以简单运行了!

www.phpzy.comtrue/php/4550.htmlTechArticleSphinx在window下的初步安装和配置 前几天在网上找安装sphinx的资料,没有找到很全面的,不是这走不通就是那不通,今天总算整出来了,整理一下。 1. windows Win32 release binaries with MySQL s...

相关文章

相关频道:

PHP之友评论

今天推荐