我几个月前安装了 Sphinx 搜索引擎,随着时间的推移,我不记得我安装的 Sphinx 版本。
如何检查我的系统中的 Sphinx 版本?
我几个月前安装了 Sphinx 搜索引擎,随着时间的推移,我不记得我安装的 Sphinx 版本。
如何检查我的系统中的 Sphinx 版本?
也许只需运行命令searchd
而不带任何参数。
我刚尝试时显示如下:
Sphinx 0.9.9-release (r2117)
Copyright (c) 2001-20009, Andrew Aksyonoff
....
只需要在终端中输入:
sphinx-build --version
运行带有'--help'参数的searchd,这将显示searchd版本:
searchd --help
Sphinx 0.9.9-release (r2117)
Copyright (c) 2001-2009, Andrew Aksyonoff
$ python -c 'import sphinx; print sphinx.__version__'
'1.1.3'
$ python -c 'print __import__("sphinx").__version__'
'1.1.3'
或者,使用pkg_resources
:
$ python -c 'import pkg_resources; print pkg_resources.require("sphinx")[0].version'
'1.1.3'
$ python -c 'print __import__("pkg_resources").require("sphinx")[0].version'
'1.1.3'
您也可以直接使用MySQL客户端进行连接。
% mysql --host=sphinx.example.com --port=9306 --protocol=tcp
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 2.2.7-id64-release (r4883)
这是服务器版本。如果主机是本地主机,则可能需要--protocol=tcp
。
Server version: 2.2.7-id64-release (r4883)
中。这是Sphinx的服务器版本。 - Johann Oskarsson.../sphinx/bin/search
请执行它
只需运行下面的命令:
searchd --version
Sphinx 3.2.1 (commit f152e0b8)
Copyright (c) 2001-2020, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Built on: Linux alpine38 4.14.69-0-vanilla #1-Alpine SMP Mon Sep 10 19:33:23 UTC 2018 x86_64 Linux
Built with: gcc 6.4.0
Build date: Jan 31 2020
Build type: release
Configure flags: '--enable-dl' '--with-mysql' '--with-pgsql' '--with-unixodbc' 'CXXFLAGS=-DSPHINX_TAG= -DNDEBUG -O3 -g1 -D__MUSL__' 'LDFLAGS=-static-libstdc++ -static-libgcc'
Compiled DB drivers: mysql-dynamic pgsql-dynamic odbc-dynamic
仅适用于版本3及以上
首先进入包含Sphinx的目录
运行以下任意一个命令
或者
searchd --status
root@453ba3cefef3:/# searchd --status
Sphinx 2.2.9-id64-release (rel22-r5006)
Copyright (c) 2001-2015, Andrew Aksyonoff
Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/etc/sphinxsearch/sphinx.conf'...
这假设你正在运行 x86-64 版本。
searchd --help
命令。 - Jerome