sergey
sergey

Reputation: 1

SphinxQL problem

plz, give me advice. why next code doesn't work:

$res = $cl->Query("SELECT * FROM goods WHERE MATCH('@pp кирпич')");

goods - index

using Sphinx 2.0.1-beta trying to use http://sphinxsearch.com/docs/manual-2.0.1.html#sphinxql-select

how can i write query SELECT * FROM goods WHERE MATCH('@pp кирпич') with php api?

Upvotes: 0

Views: 1619

Answers (1)

pat
pat

Reputation: 16226

The PHP API is for the older communications with Sphinx - not SphinxQL. If you want to connect to Sphinx and query using SphinxQL, you need to use a MySQL library instead (I'm not a PHP developer, so I don't know what options are out there), and connect to Sphinx using the port specified in your sphinx configuration file (with the mysql41 setting). Then you make the query using that MySQL connection just like you would a normal SQL call to a normal database.

In short: the PHP API is not useful at all for SphinxQL queries.

Upvotes: 3

Related Questions