Ejemplo n.º 1
0
    var_dump($expected);
    print "\n";
    exit(1);
}
class testspy extends XapianMatchSpy
{
    public $matchspy_count = 0;
    function apply($doc, $wt)
    {
        if (substr($doc->get_value(0), 0, 3) == "ABC") {
            ++$this->matchspy_count;
        }
    }
}
$matchspy = new testspy();
$enquire->clear_matchspies();
$enquire->add_matchspy($matchspy);
$enquire->get_mset(0, 10);
if ($matchspy->matchspy_count != 4) {
    print "Unexpected matchspy count of {$matchspy->matchspy_count}\n";
    exit(1);
}
# Regression test for SWIG bug - it was generating "return $r;" in wrapper
# functions which didn't set $r.
$indexer = new XapianTermGenerator();
$doc = new XapianDocument();
$indexer->set_document($doc);
$indexer->index_text("I ask nothing in return");
$indexer->index_text_without_positions("Tea time");
$indexer->index_text("Return in time");
$s = '';