如何检查Sphinx版本?

48

我几个月前安装了 Sphinx 搜索引擎,随着时间的推移,我不记得我安装的 Sphinx 版本。

如何检查我的系统中的 Sphinx 版本?

9个回答

44

也许只需运行命令searchd而不带任何参数。

我刚尝试时显示如下:

Sphinx 0.9.9-release (r2117)
Copyright (c) 2001-20009, Andrew Aksyonoff

....

38

只需要在终端中输入:

sphinx-build --version

37

运行带有'--help'参数的searchd,这将显示searchd版本:

searchd --help
Sphinx 0.9.9-release (r2117)
Copyright (c) 2001-2009, Andrew Aksyonoff

搜索最初对我来说是可行的,但在升级了我需要的一个x86-64包之后,我需要执行 searchd --help 命令。 - Jerome

8
以下是Python自身实现它的几种方法:
$ 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'

4
错误的斯芬克斯!问题是关于 SQL 搜索工具 Sphinx 的。不过,这个回答确实解决了我的问题。我正在寻找 Python 版本的,所以谢谢! :-) - Andrew Hundt

5

您也可以直接使用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


这是Sphinx正在使用的MySQL数据库客户端版本,因此使用了“--port=9306”。问题是“如何检查Sphinx版本?”可以在Sphinx服务器上通过命令行中的“searchd”找到。 “searchd”响应将包括类似于“Sphinx 2.2.9-id64-release(rel22-r5006)”的内容。这假定您正在运行x86-64版本。 - DeeZone
版本号在字符串 Server version: 2.2.7-id64-release (r4883) 中。这是Sphinx的服务器版本。 - Johann Oskarsson

4

.../sphinx/bin/search

请执行它


2
你可能需要在“just do it”指令中添加一个“which search”,因为我认为典型的Sphinx安装不支持这样的命令。也许你正在寻找“searchd”? - DeeZone

0

只需运行下面的命令:

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及以上


0

首先进入包含Sphinx的目录

运行以下任意一个命令

  • search
  • searchd
  • indexer

或者

  • indexer --config /home/myuser/sphinx.conf --all
  • indexer --rotate --all

1
当然是“searchd”或“indexr”,但“search”必须是您设置的别名,因为它不是典型Sphinx安装的一部分。所有“or”项都与原始问题“如何检查Sphinx版本?”无关。 - DeeZone

0
通常在运行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 版本。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接