I
I
Igor Yatsevich2014-01-14 12:20:26
Sphinx
Igor Yatsevich, 2014-01-14 12:20:26

How to find out how many records were found in SphinxSE?

There is a certain index, access to which goes through SphinxSE.
For example, like this:

select
  Page.Name,
  SearchCatalog.*
  
from
  SearchCatalog
  join Page
    on Page.Id = SearchCatalog.id
  
where
  SearchCatalog.`query` = 'рюшь рюшь*;limit=2'

What is the best way to find the number of objects that satisfy a given query? In the documentation, I found only a way to execute the following request:
SHOW STATUS LIKE 'Sphinx_total_found';
Is this the right solution? won't the result be interrupted by another search query, which was performed for example by another user on the site? Those. is it thread-safe way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
egor_nullptr, 2014-01-14
@IgoNsk

Yes, this is the right decision, because. the 'Sphinx_total_found' variable is bound to the current connection.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question