Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multimatch query couldn't get second query results #185

Open
umutbesler opened this issue Sep 27, 2019 · 0 comments
Open

Multimatch query couldn't get second query results #185

umutbesler opened this issue Sep 27, 2019 · 0 comments

Comments

@umutbesler
Copy link

umutbesler commented Sep 27, 2019

Hello,

I am trying to make a query and then get the "total_found" by executing "SHOW META" query.

$conn = new Connection();

$conn->setParams(array('host' => 'localhost', 'port' => 9306));

$cl = new SphinxQL($conn);
$cl->select();
$cl->from("frtIndex");
$cl->limit($pageIndex, 5);

$tipler = array(
    "1",
    "4",
    "3",
);

if(in_array($_GET['t'], $tipler)) {
    $cl->where("tip_id", "=", $_GET['t']);
}

$q = strtolower(trim($_GET['q']));
$cl->match(array("name", "detail"), $q);
$cl->enqueue((new SphinxQL($conn))->query('SHOW META'));
//$cl->enqueue((new Helper($conn))->showMeta());

$cl->compileSelect();
$sql = $cl->getCompiled();

print_r($sql);

$result = $cl->executeBatch();

$res1 = $result->getNext();
$res2 = $result->getNext();

print_r($res1);
print_r($res2);

The res2 is empty. I can only get the res1 (which has the select query results in it).

Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant