在windows下安装sphinx-for-chinese-2.1.0

安装步骤:

1.从http://code.google.com/p/sphinx-for-chinese/downloads/list 下载想要的版本,如sphinx-for-chinese-2.1.0-dev-r3361-win32.zip。

2.解压sphinx-for-chinese-2.1.0-dev-r3361-win32.zip 到想要放置的目录,如d:\server\sphinx-for-chinese-2.1.0 。

3.打开d:\server\sphinx-for-chinese-2.1.0\sphinx.conf.in文件,批量查找将@CONFDIR@ 替换成d:/server/sphinx-for-chinese-2.1.0 。

4.安装自启动程序,打开windows命令提示符窗口(win7以后的系统用管理员方式打开),执行d:\server\sphinx-for-chinese-2.1.0\bin\searchd --install --config d:\server\sphinx-for-chinese-2.1.0\sphinx.conf.in --servicename SphinxSearch 。

5.启动sphinx 服务,在windows命令提示符中执行 net start SphinxSearch 。

第一次启动需要这样,重启系统后会自动启动服务。

6.索引配置和在Linux下的配置一样,请参考其它参考资料。

(本文出自php_sir的新浪博客,用户名php_sir,首页链接:http://blog.sina.com.cn/phpsir,未经本人(php_sir)同意禁止转载)

以下是安装自带的安装教程:

Installing Sphinx on Windows

Installing Sphinx on a Windows server is often easier than installing on a Linux environment; unless you are preparing code patches, you can use the pre-compiled binary files from the Downloads area on the website.

  1. Extract everything from the .zip file you have downloaded - sphinx-2.0.1-beta-win32.zip, or sphinx-2.0.1-beta-win32-pgsql.zip if you need PostgresSQL support as well. (We are using version 2.0.1-beta here for the sake of example only; be sure to change this to a specific version you're using.) You can use Windows Explorer in Windows XP and up to extract the files, or a freeware package like 7Zip to open the archive.

    For the remainder of this guide, we will assume that the folders are unzipped into C:\Sphinx, such that searchd.exe can be found in C:\Sphinx\bin\searchd.exe. If you decide to use any different location for the folders or configuration file, please change it accordingly.

  2. Edit the contents of sphinx.conf.in - specifically entries relating to @CONFDIR@ - to paths suitable for your system.
  3. Install the searchd system as a Windows service:

    C:\Sphinx\bin>
    C:\Sphinx\bin\searchd --install --config C:\Sphinx\sphinx.conf.in
    --servicename SphinxSearch

  4. The searchd service will now be listed in the Services panel within the Management Console, available from Administrative Tools. It will not have been started, as you will need to configure it and build your indexes with indexer before starting the service. A guide to do this can be found under Quick tour.

    During the next steps of the install (which involve running indexer pretty much as you would on Linux) you may find that you get an error relating to libmysql.dll not being found. If you have MySQL installed, you should find a copy of this library in your Windows directory, or sometimes in Windows\System32, or failing that in the MySQL core directories. If you do receive an error please copy libmysql.dll into the bin directory.

发表评论

电子邮件地址不会被公开。 必填项已用*标注