- Principle:
- Using indexer in Sphinx to generate index data
- service/web-end uses searched to invoke index data
- Steps:
- Download Sphinx:
- : http://sphinxsearch.com/downloads/release/This can be based on your computer's system to download the appropriate installation package.
- PS: I am a mac, so I downloaded the MAC installation package, according to the installation found on the document does not work, and later I downloaded the first is the Source tarball (tar.gz) before the installation was successful.
- Installing Sphinx
- Reference address: Http://sphinxsearch.com/docs/current.html#compiling-from-source Step by step to be able. Mainly configure configuration, the others are the same. I am XAMPP so write
./configure
--prefix=/usr/local/sphinx--with-mysql=/applications/xampp/xamppfiles. And then the egg ./configure
,--prefix=/usr/local/sphinx actually can.
- cd/usr/local/sphinx/view this directory, with the Bin,etc,var three folders, is the success of Ann.
- Use the indexer tool in Sphinx to index data on a data table
- Indexer's Location:/usr/local/sphinx/bin
- Method: Bin/indexer-c etc/sphinx.conf test1
- What is the problem 1:sphinx.conf.
- Sphinx.conf is a configuration file for Sphinx
- Location/usr/local/sphinx/etc, no words, create a new one or copy a
- Question 2:test1: The index name of the index file that needs to be indexed, some in the configuration file
- So we need to configure the sphinx.conf file first.
- Reference Address: Http://www.sphinxsearch.org/sphinx-tutorial
- Reference Address: http://www.apoyl.com/?p=290
- For a description of each configuration item, refer to: http://sphinxsearch.com/docs/current.html#conf-reference
- Configure each reference. Save, execute 3.1. Unexpectedly error, prompt language: Library not loaded:libmysqlclient.18.dylib on the net looked under, seemingly is the file does not exist
- Reference Address: http://blog.sina.com.cn/s/blog_68f3bc280100supn.html
- Because I use XAMPP, is not the original ecological MySQL, so the file does not exist is also reasonable.
- I went to XAMPP to find a similar file/applications/xampp/xamppfiles/lib/libmysqlclient.18.dylib. Then execute sudo ln-s/applications/xampp/xamppfiles/lib/libmysqlclient.18.dylib/usr/lib/libmysqlclient.18.dylib
- On the command line that executes 3.1. Found OK.
- View cd/usr/local/sphinx/var/data/. (The path of some of the indexes in the sphinx.conf file is found.)
- This data, both for Test1 index data, was generated successfully.
- Test whether the index can be used
- /usr/local/sphinx/bin/searchd--config/usr/local/sphinx/etc/sphinx.conf--status
Mac Sphinx + MySQL + php for full-text search (XAMPP)