How to execute a query like:

SELECT db1.*, db2.val AS VAL FROM db1, db2 WHERE db2.id = db1.val 

in SphinxQL ? Now in sphinx.conf there are 2 index and 2 source for db1 and db2 . Each sample of this type:

 sql_query = SELECT * FROM db1 

for the second db2 - respectively. And in yii, I make a query of the form:

 SELECT * FROM db1, db2 WHERE MATCH('{$q}') 

For one table prints fine.

And how to make for two?

    2 answers 2

    In Sphinx, you cannot join between indices. Therefore, the answer - no way.

      You can specify the filter Select one_name, two_name from index_one, index_two where base_field_example = 7 by the same fields base_field_example in two indexes index_one, index_two