searchfull-text-searchsearch-enginesphinxfulltext-index

SphinxSearch: Cannot get result from (remote) agent


I build 2 searchd instance on different server(namely A and B) and build a distributed index on A. However, when I query A from client, I only got result from A's index. My problem is I cannot get result from B' index, I am pretty sure I configure correct.

I tried: * replace hostname with IP adresses * I am pretty sure that I have not get result from B's index

A's sphinx.conf

index distributed_index
{
    type = distributed
    local = A_index
    agent = 192.168.13.189:9312:B_index
    agent_connect_timeout = 1000
    agent_query_timeout = 3000
}

client query code(python)

import sphinxapi
sphinx_host = 'A'
sphinx_port = 9312
SphinxClient = sphinxapi.SphinxClient()
SphinxClient.SetServer(sphinx_host,sphinx_port)
SphinxClient.SetMatchMode(sphinxapi.SPH_MATCH_EXTENDED)
res = SphinxClient.Query("")

when I indexer --all --rotate, got a WARNING:skipping non-plain index 'distributed_index'

I expect results from both from A and B when I query from client.


Solution

  • I got it guys, I got it!

    The problem is not on the server(A&B), I configured them correctly. It is becacuse I am not familiar with the API.Query() API need to specify the key words as well as the queried index.

    res = SphinxClient.Query("","distributed_index_name") gives me the correct result!

    If you encounter similar problems, be free to ask, I am happy to help.