Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
sphinx_default_server and sphinx_default_port are (almost) never used when a sphinx client is created. So the client will use localhost:3312 as searchd server, which is a problem when searchd runs on a different server or port.
SetServer (from the sphinx api) should be used after creating a sphinx client (new SphinxClient();).
I am working on a patch.
Comment | File | Size | Author |
---|---|---|---|
#1 | non-localhost-server.patch | 4.07 KB | johannesdr |
Comments
Comment #1
johannesdr CreditAttribution: johannesdr commentedI created a patch that will make sphinx use the default_server and default_port set in admin/settings/sphinx instead of the default localhost and 3312.
Comment #2
johsw CreditAttribution: johsw commentedCould you explain, what the patch does?
Comment #3
johannesdr CreditAttribution: johannesdr commentedEvery time the sphinx module checks to see if the sphinx deamon is online it uses
$connect = $client->_Connect();
This uses the connect function from the sphinx php api. And when no server is specified it uses localhost and the standard port.
Even if you have filled in a server and port in the sphinx administration page it will still use localhost.
We had our sphinx deamon on a different server so we allways got the message: Searchd not running.
What we did is replace
with
So now it will first get the variables entered in the administration page. If these are not set it will use the default localhost and 3312 port.
Comment #4
nestor.mata CreditAttribution: nestor.mata commentedThis also happens on version 6.x.
This is fixed in version 6.x-1.2.
~Nestor