In linux, the sphtracing full-text search engine-stubbornRookie has recently encountered various problems due to the company's website requirements.
Server System: centos7 (64-bit)
For details, see the installation tutorial on the installation website for coreseek 3.2.14.
Here are some notes.
1. install the basic development library and database dependencies before installation.
yum install make gcc g++ gcc-c++ libtool autoconf automake imake mysql-devel libxml2-devel expat-devel:
2: download
wget http://www.coreseek.cn/uploads/csft/3.2/coreseek-3.2.14.tar.gz
3: install mmseg. There should be no problems here.
$ Mmseg-3.2.14 $. cd. /bootstrap # The output warning information can be ignored. If an error occurs, you need to solve the problem $. /configure -- prefix =/usr/local/mmseg3 $ make & make install $ cd ..
4. install csft
Go to The csft directory and first modify the src/sphixexpr. cpp file. the compilation will go wrong in three places.
Change ExprEval to this-> ExprEval
Perform the next installation.
sh buildconf.sh ./configure --prefix=/usr/local/coreseek --without-unixodbc --with-mmseg --with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ --with-mmseg-libs=/usr/local/mmseg3/lib/ --with-mysqlmake && make install
5: Copy the configuration file to the installation directory.
cd /usr/local/coreseek/etccp sphinx.conf.dist sphinx.confvim sphinx.conf
It mainly modifies database parameters. for other warning issues, comment out the corresponding content in the configuration file. no problems have been found.
type = mysqlsql_host = localhostsql_user = rootsql_pass = sql_db = testsql_port = 3306sql_query_pre = SET NAMES utf8
Save and generate the index
cd /usr/local/coreseek/bin./indexer -c /usr/local/coreseek/etc/sphinx.conf --all./searchd -c /usr/local/coreseek/etc/sphinx.conf
Import test data and call Test Files
Require ("sphinxapi. php "); $ cl = new SphinxClient (); $ cl-> SetServer ('2017. 0.0.1 ', 9312); $ cl-> SetConnectTimeout (3); $ cl-> SetArrayResult (true); $ cl-> SetMatchMode (SPH_MATCH_ANY ); $ res = $ cl-> Query ('network search', "*"); print_r ($ cl); print_r ($ res );
There should be no problem, ensure that the system Chinese zh_CN.UTF-8, in order to ensure that the Chinese display
The following is a situation in your own company. some may have such a situation.
The search engine is on one server while the website and database are on another server.
1: If libmysqlclient. so.18 shared library cannot be found during coreseek installation
Copy libmysqlclient. so.18 on the mysql server, and the path is/usr/lib64/mysql/libmysqlclient. so.18.
2: whether the firewall port of the server where the search engine is located is open
Install centos7 first
yum install firewalld-config
Then enable the port
firewall-cmd [--zone=
] --add-port=
[-
]/
[--timeout=
]
firewall-cmd --permanent --add-port=10-9900/tc
Query
firewall-cmd --permanent --query-port=80/tcp
3: The php api version of the website must be the same as that of coreseek.
The test process can be directly output in php.
Var_dump ($ cl); // $ cl is the sphinxClient object.
View error information.
The above problems should be solved and can be used normally.