Sphinx search does not work

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
lem0na
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Jun 2013, 01:01

Sphinx search does not work

Postby lem0na » 14 Jul 2013, 16:45

Hi all,

I was trying to enable Sphinx search, Have confugured it like docs say. Index is created and regulary updated via cron.
I have tried to debug it on my laptop and I got this in error log:

[Sun Jul 14 19:33:00 2013] [error] [client 172.16.223.2] PHP Fatal error: Cannot redeclare class SphinxClient in /var/www/rss.localhost/htdocs/tt-rss/lib/sphinxapi.php on line 385, referer: http://rss.localhost/index.php?XDEBUG_S ... ans-xdebug
[Sun Jul 14 19:33:00 2013] [error] [client 172.16.223.2] PHP Stack trace:, referer: http://rss.localhost/index.php?XDEBUG_S ... ans-xdebug
[Sun Jul 14 19:33:00 2013] [error] [client 172.16.223.2] PHP 1. {main}() /var/www/rss.localhost/htdocs/tt-rss/backend.php:0, referer: http://rss.localhost/index.php?XDEBUG_S ... ans-xdebug
[Sun Jul 14 19:33:00 2013] [error] [client 172.16.223.2] PHP 2. Feeds->view() /var/www/rss.localhost/htdocs/tt-rss/backend.php:130, referer: http://rss.localhost/index.php?XDEBUG_S ... ans-xdebug
[Sun Jul 14 19:33:00 2013] [error] [client 172.16.223.2] PHP 3. Feeds->format_headlines_list($feed = -3, $method = 'ForceUpdate', $view_mode = 'all_articles', $limit = 30, $cat_view = FALSE, $next_unread_feed = '', $offset = '', $vgr_last_feed = '', $override_order = FALSE, $include_children = TRUE) /var/www/rss.localhost/htdocs/tt-rss/classes/feeds.php:877, referer: http://rss.localhost/index.php?XDEBUG_S ... ans-xdebug
[Sun Jul 14 19:33:00 2013] [error] [client 172.16.223.2] PHP 4. queryFeedHeadlines($feed = -3, $limit = 30, $view_mode = 'all_articles', $cat_view = FALSE, $search = 'angular', $search_mode = 'this_feed', $override_order = FALSE, $offset = 0, $owner_uid = 0, $filter = FALSE, $since_id = 0, $include_children = TRUE, $ignore_vfeed_group = *uninitialized*) /var/www/rss.localhost/htdocs/tt-rss/classes/feeds.php:244, referer: http://rss.localhost/index.php?XDEBUG_S ... ans-xdebug
[Sun Jul 14 19:33:00 2013] [error] [client 172.16.223.2] PHP 5. sphinx_search($query = 'angular', $offset = 0, $limit = 500) /var/www/rss.localhost/htdocs/tt-rss/include/functions.php:2302, referer: http://rss.localhost/index.php?XDEBUG_S ... ans-xdebug
[Sun Jul 14 19:33:00 2013] [error] [client 172.16.223.2] PHP 6. require_once() /var/www/rss.localhost/htdocs/tt-rss/include/functions.php:3791, referer: http://rss.localhost/index.php?XDEBUG_S ... ans-xdebug

Any idea what is the source of the problem and how to fix it?
Thanks in advance.

b.r.
lem0na

lem0na
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Jun 2013, 01:01

Re: Sphinx search does not work

Postby lem0na » 14 Jul 2013, 17:05

an update:
I digg into php docs and see that the internat Sphinx api support is called SphinxClient and probably this raises name colision
Do TTRSS have own Sphinx implementation that is independant from the one in PHP and I have to disable the PHP native implementation?

b.r.
lem0na

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Sphinx search does not work

Postby fox » 14 Jul 2013, 17:14

This is most probably the case, tt-rss uses a separate client library bundled I think.

gbcox
Bear Rating Master
Bear Rating Master
Posts: 149
Joined: 25 Apr 2013, 04:52

Re: Sphinx search does not work

Postby gbcox » 14 Jul 2013, 17:56


lem0na
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Jun 2013, 01:01

Re: Sphinx search does not work

Postby lem0na » 14 Jul 2013, 18:12

HI gbcox,

OS: Gentoo Linux
Sphinx: version 2.0.8
searchd.log (last 20 rows):
[Sun Jul 14 19:00:07.788 2013] [20302] rotating index 'delta': success
[Sun Jul 14 19:00:07.795 2013] [20302] rotating finished
[Sun Jul 14 19:20:07.347 2013] [20302] caught SIGHUP (seamless=1, in queue=1)
[Sun Jul 14 19:20:07.359 2013] [20302] rotating index 'delta': success
[Sun Jul 14 19:20:07.363 2013] [20302] rotating finished
[Sun Jul 14 19:40:07.277 2013] [20302] caught SIGHUP (seamless=1, in queue=1)
[Sun Jul 14 19:40:07.289 2013] [20302] rotating index 'delta': success
[Sun Jul 14 19:40:07.293 2013] [20302] rotating finished
[Sun Jul 14 20:00:06.342 2013] [20302] caught SIGHUP (seamless=1, in queue=1)
[Sun Jul 14 20:00:06.354 2013] [20302] rotating index 'delta': success
[Sun Jul 14 20:00:06.359 2013] [20302] rotating finished
[Sun Jul 14 20:20:07.368 2013] [20302] caught SIGHUP (seamless=1, in queue=1)
[Sun Jul 14 20:20:07.381 2013] [20302] rotating index 'delta': success
[Sun Jul 14 20:20:07.385 2013] [20302] rotating finished
[Sun Jul 14 20:40:06.583 2013] [20302] caught SIGHUP (seamless=1, in queue=1)
[Sun Jul 14 20:40:06.596 2013] [20302] rotating index 'delta': success
[Sun Jul 14 20:40:06.600 2013] [20302] rotating finished
[Sun Jul 14 21:00:09.532 2013] [20302] caught SIGHUP (seamless=1, in queue=1)
[Sun Jul 14 21:00:09.555 2013] [20302] rotating index 'delta': success
[Sun Jul 14 21:00:09.568 2013] [20302] rotating finished

gbcox
Bear Rating Master
Bear Rating Master
Posts: 149
Joined: 25 Apr 2013, 04:52

Re: Sphinx search does not work

Postby gbcox » 14 Jul 2013, 18:24

Were you able to check for packages which contain "sphinx"?

gbcox
Bear Rating Master
Bear Rating Master
Posts: 149
Joined: 25 Apr 2013, 04:52

Re: Sphinx search does not work

Postby gbcox » 14 Jul 2013, 18:26

and did you activate sphinx in your config.php file for ttrss?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Sphinx search does not work

Postby fox » 14 Jul 2013, 18:29


lem0na
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Jun 2013, 01:01

Re: Sphinx search does not work

Postby lem0na » 14 Jul 2013, 18:39

gbcox:
Shphix is activated in config.php and I checked in Gentoo's package manager

fox: I think this will prevent the error but I am not sure if tt-rss's implementation is compatible with the one provided by PHP. Probably it is better to include in docs that tt-rss privides its own Shphix implemtation or switch to the PHP implemtation in future versions (requires PHP >= 5.2.2)

gbcox
Bear Rating Master
Bear Rating Master
Posts: 149
Joined: 25 Apr 2013, 04:52

Re: Sphinx search does not work

Postby gbcox » 14 Jul 2013, 19:24

I can't speak for Gentoo because I don't have it.... but in Fedora, there is an optional package called:

php-pecl-sphinx and it's dependency of libsphinxclient

These are not required for ttrss, and as you have discovered cause issues.

The easiest solution (if you can on Gentoo) would be to remove them from your system.

I installed them as a test and did have issues, even with the patch that Fox specified above. The errors I received are as follows:

E_WARNING (2) classes/db/pgsql.php:54 pg_num_rows() expects parameter 1 to be resource, boolean given
E_WARNING (2) classes/db/pgsql.php:54 pg_num_rows() expects parameter 1 to be resource, boolean given

E_USER_ERROR (256) classes/db/pgsql.php:43 Query SELECT DISTINCT date_entered, guid, ttrss_entries.id,ttrss_entries.title, updated, label_cache, tag_cache, always_display_enclosures, site_url, note, num_comments, comments, int_id, uuid, hide_images, unread,feed_id,marked,published,link,last_read,orig_feed_id, last_marked, last_published, ttrss_feeds.title AS feed_title,favicon_avg_color, content, content AS content_preview, author,score FROM ttrss_entries,ttrss_user_entries,ttrss_feeds WHERE ttrss_user_entries.feed_id = ttrss_feeds.id AND ttrss_user_entries.ref_id = ttrss_entries.id AND ttrss_user_entries.owner_uid = '2' AND ref_id IN (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) AND true ORDER BY updated DESC LIMIT 30 OFFSET 0 failed:

E_WARNING (2) classes/db/pgsql.php:38 pg_query(): Query failed: ERROR: syntax error at or near "," LINE 27: ref_id IN (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,... ^

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Sphinx search does not work

Postby fox » 14 Jul 2013, 19:29

Well if the api is incompatible I'll add a sanity check which would prevent sphinx from working if conflicting library is detected.

e: https://github.com/gothfox/Tiny-Tiny-RS ... 4849637297

It would be better if someone who has this installed would make it work with the other library, of course.

lem0na
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Jun 2013, 01:01

Re: Sphinx search does not work

Postby lem0na » 14 Jul 2013, 19:48

Hi gbcox,

Thanks for the explanation. I have resolved the problem after the second post - just disabled the sphinx extension in apache.
For me now it works but did not returns the results that I expect.
I do not if this is the actual result that get or you omited the entry ids - if the firts there is a problme and I have no idea why this happens. Why there are no ids (looks like sphinx returns some values)
Rignt now I am still debuuging to get the results that I expect.

b.r.
lem0na

lem0na
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Jun 2013, 01:01

Re: Sphinx search does not work

Postby lem0na » 14 Jul 2013, 19:57


lem0na
Bear Rating Trainee
Bear Rating Trainee
Posts: 10
Joined: 14 Jun 2013, 01:01

Re: Sphinx search does not work

Postby lem0na » 14 Jul 2013, 20:06


User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Sphinx search does not work

Postby fox » 14 Jul 2013, 20:29

>I think PHP is case sensitive about variables and function names. Right?

Don't think so. Methods are certainly not case sensitive.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 11 guests