Full-Text search for Mac under Sphinx + MySQL + PHP (XAMPP)

Source: Internet
Author: User

  1. Principle:
    1. Using indexer in Sphinx to generate index data
    2. service/web-end uses searched to invoke index data
  2. Steps:
    1. Download Sphinx:
      1. : http://sphinxsearch.com/downloads/release/This can be based on your computer's system to download the appropriate installation package.
      2. 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.
    2. Installing Sphinx
      1. 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.
      2. cd/usr/local/sphinx/view this directory, with the Bin,etc,var three folders, is the success of Ann.
    3. Use the indexer tool in Sphinx to index data on a data table
      1. Indexer's Location:/usr/local/sphinx/bin
      2. Method: Bin/indexer-c etc/sphinx.conf test1
      3. What is the problem 1:sphinx.conf.
        1. Sphinx.conf is a configuration file for Sphinx
        2. Location/usr/local/sphinx/etc, no words, create a new one or copy a
      4. Question 2:test1: The index name of the index file that needs to be indexed, some in the configuration file
      5. So we need to configure the sphinx.conf file first.
        1. Reference Address: Http://www.sphinxsearch.org/sphinx-tutorial
        2. Reference Address: http://www.apoyl.com/?p=290
        3. For a description of each configuration item, refer to: http://sphinxsearch.com/docs/current.html#conf-reference
        4. 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
        5. Reference Address: http://blog.sina.com.cn/s/blog_68f3bc280100supn.html
        6. Because I use XAMPP, is not the original ecological MySQL, so the file does not exist is also reasonable.
        7. 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
        8. On the command line that executes 3.1. Found OK.
        9. View cd/usr/local/sphinx/var/data/. (The path of some of the indexes in the sphinx.conf file is found.)
        10. This data, both for Test1 index data, was generated successfully.
    4. Test whether the index can be used
      1. /usr/local/sphinx/bin/searchd--config/usr/local/sphinx/etc/sphinx.conf--status

Mac Sphinx + MySQL + php for full-text search (XAMPP)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.