Install Coreseek + PHP on Ubuntu

Source: Internet
Author: User
Tags solr
Coreseek is a full-text search engine based on the sphinx engine that supports cooperation with the mmseg Chinese Word Segmentation module to complete Chinese. Compared with SQL operations, Coreseek load is negligible. Of course, similar index servers also provide solr for Java. One of the main reasons I chose coreseek is that it can be compatible with the existing mysql client after configuration and can be directly embedded into mysql to become one of the mysql engines. First, download the installation package. I chose the latest stable.

Coreseek is a full-text search engine based on the sphinx engine that supports cooperation with the mmseg Chinese Word Segmentation module to complete Chinese. Compared with SQL operations, Coreseek load is negligible. Of course, similar index servers also provide solr for Java. One of the main reasons I chose coreseek is that it can be compatible with the existing mysql client after configuration and can be directly embedded into mysql to become one of the mysql engines.

First, download the installation package. I chose the latest stable version. But you can't say that even the stable version of coreseek is not perfect in terms of stability, compatibility, and flexibility, at least it cannot be compared with classic applications such as apache.

Install the Ubuntu development kit:
Apt-get install make gcc g ++ automake libtool mysql-client libmysqlclient15-dev libxml2-dev libexpat1-dev

Decompress:
Tar xzvf coreseek-3.2.14.tar.gz
Cd coreseek-3.2.14

The mmseg csft testpack must have at least three directories.

Install the mmseg Chinese Word Segmentation Module

Cd mmseg-3.2.14
./Bootstrap
./Configure-prefix =/usr/local/mmseg3 # Do not like this official directory configuration. After changing the directory, the configuration will not take effect for a long time. I will talk about it later.
Make
Make install
Cd ../testpack
/Usr/local/mmseg3/bin/mmseg-d/usr/local/mmseg3/etc var/test. xml # test result. Make sure that the terminal can see utf8 Chinese and the result after word segmentation is displayed.

Install Python package

Although coreseek supports direct mysql connections, this setting is not flexible considering word segmentation and table sharding. My solution is to pre-process the mysql data through the python script and then transmit the data to coreseek to create an index. Another advantage is the "Universal Data Source"-memcache, redis, and other storage solutions that almost do not count on official support of coreseek, and can be indexed as long as there is a python api.

The python interface described in the official installation manual is based on ActivePython instead of the python language. ActivePython is a third-party package. It is far from the convenience of python provided by the system. At first, it was tested several times with python, but it failed. Later, based on the error information, it found the cause.

Apt-get install python-dev python-sqlite python-mysqldb python-memcache

Install coreseek

Cd./csft-3.2.14
./Buildconf. sh
. /Configure-prefix =/usr/local/coreseek-without-unixodbc-with-mmseg-supported des =/usr/local/mmseg3/include/mmseg/-- mmseg-libs =/usr/local/mmseg3/lib/-with-mysql-with-python
Make
Make install

Cd ../testpack
/Usr/local/coreseek/bin/indexer-c etc/csft. conf-all
/Usr/local/coreseek/bin/search-c etc/csft. conf network search # No problem

Install libsphinxclient

In the official coreseek tutorial, php is recommended to directly include a php file. In fact, php has an independent sphsf-module that can directly operate coreseek (coreseek is sphsf !) I have already entered the official php function library, and the efficiency improvement is not a little bit! However, the php module depends on the libsphinxclient package.

Cd ../csft-3.2.14/api/libsphinxclient
./Configure
Make
Make install
Ldconfig

Install php-sphinx

Apt-get install php5-dev
Wget http://pecl.php.net/get/sphinx-1.1.0.tgz
Tar vzxf sphinx-1.1.0.tgz
Cd sph0000- 1.1.0
Phpize
./Configure
Make
Make install

Make sure that php. ini is modified after successful modification, or follow the ubuntu configuration rules.
Echo "extension = sphsion. so">/etc/php5/conf. d/sphinx. ini

Restart apache or fast-cgi. Check that phpinfo () is successfully installed as follows.

Sphinx

Sphsf-support Enabled
Version 1.1.0
Revision $ Revision: 303462 $

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.