Future support for Sphinx Search

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The next feature release of phpBB 3 will be 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.2.x. If you need support for phpBB 3.2.x please visit the 3.2.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Post Reply
GarageChemist
Registered User
Posts: 2
Joined: Tue Oct 30, 2018 3:39 am

Future support for Sphinx Search

Post by GarageChemist » Thu Nov 01, 2018 3:27 am

It sounds like from the Sphinx release notes that the author plans to phase out the API he formerly used, in favor of using an SQL-like query syntax he calls "SphinxQL". There seem to be a number of new features in the works too, that he only plans to support via the SphinxQL interface. I can't say I disagree with that decision. This interface allows for a much easier means of interacting with the search application, as it can emulate a MySQL database server and thus accept queries from the mysql client. That means that the PHP MySQL API can do this too.

The current Sphinx integration is definitely showing its age, and I don't think it will actually work with the recent versions without making a few changes to it. It's not very easy to tell where the code for generating the Sphinx config file stops and the code for actually running the search begins. It would help if the code was divided into two different files, since once the config file is set up, the code for generating it just gets in the way. But if the MySQL API can be used for making queries, then any new code would probably be minimal.

Even though it works well enough, the automatically-generated source and index identifiers are needlessly long and inconvenient to type in during testing. I would suggest using "source_{PREFIX}_main" or "index_{PREFIX}_delta" initially, then maybe try again with a number on the end if that name is taken. Just because Sphinx looks like it's going to be adding a bunch of useful features in the future, and testing them from the command line requires entering that identifier regularly.

Anyway, here's the more recent documentation for Sphinx:

http://sphinxsearch.com/docs/sphinx3.html

At the risk of sounding like I'm requesting support, I've found that when querying Sphinx in phpBB, the results are returned only slowly, and they're different from the ones I get when making the query on the backend. The backend query results that I enter manually in a console are great, and return instantly. Both types of queries show up in Sphinx's logs, so I'm not sure what to make of it. The only major difference seems to be the protocol that's being used, unless somehow my old MySQL fulltext search index is being used when it shouldn't be. But if this is a bug, maybe this information is relevant.

User avatar
ThE KuKa
Registered User
Posts: 8
Joined: Sun Dec 14, 2003 2:59 pm
Location: Barcelona - Spain
Contact:

Re: Future support for Sphinx Search

Post by ThE KuKa » Thu Nov 01, 2018 1:56 pm

I thought I was already incorporated...
https://www.phpbb.com/about/features/#sphinxfulltext
phpBB International Support Team (Spanish - Español) - Online Since 2003
phpBB 3.1 Testing and Translating (Spanish - Español) - phpBB Spain GitHub Account
Author Translation (Spanish - Spain)

GarageChemist
Registered User
Posts: 2
Joined: Tue Oct 30, 2018 3:39 am

Re: Future support for Sphinx Search

Post by GarageChemist » Fri Nov 02, 2018 11:28 pm

Yes, it was incorporated, but there are two ways to query the Sphinx search engine: via the original Sphinx API protocol, and via an SQL-like querying system called "SphinxQL". The former is being phased out in favor of the latter. The current implementation appears to derive from a phpBB mod that was written 10 years ago, and needless to say, a lot has changed since then.

Looking at the trajectories that phpBB and Sphinx have followed in their development, it would seem like if there's any update to the phpBB Sphinx implementation, it ought to make use of the "SphinxQL" system of querying, rather than the older API that's used in the current implementation.

User avatar
Ger
Registered User
Posts: 291
Joined: Mon Jul 26, 2010 1:55 pm
Location: 192.168.1.100
Contact:

Re: Future support for Sphinx Search

Post by Ger » Mon Nov 05, 2018 7:45 am

Wouldn't that also depend on the version of Sphinx installed on the server? E.g. wouldn't phpBB need to support both "old and new" Spinx?
Above message may contain errors in grammar, spelling or wrongly chosen words. This is because I'm not a native speaker. My apologies in advance.

User avatar
JoshyPHP
Registered User
Posts: 364
Joined: Fri Jul 08, 2011 9:43 pm

Re: Future support for Sphinx Search

Post by JoshyPHP » Mon Nov 05, 2018 3:29 pm

SphinxQL has been around since 0.9.9-rc2 so it should cover any version of Sphinx released this decade.

User avatar
Ger
Registered User
Posts: 291
Joined: Mon Jul 26, 2010 1:55 pm
Location: 192.168.1.100
Contact:

Re: Future support for Sphinx Search

Post by Ger » Tue Nov 06, 2018 8:30 am

OK, so just a simple mention in the release notes would cover that.
Above message may contain errors in grammar, spelling or wrongly chosen words. This is because I'm not a native speaker. My apologies in advance.

Hunchman801
Registered User
Posts: 14
Joined: Fri Sep 11, 2015 12:55 pm

Re: Future support for Sphinx Search

Post by Hunchman801 » Wed Nov 14, 2018 5:29 pm

By the way, is there a reason EscapeString is used on all Sphinx queries? It would be quite handy to leverage the features of the extended query syntax.

Post Reply