Skip to content

Multimatch query couldn't get second query results #185

@umutbesler

Description

@umutbesler

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions