exit(1); } $doc->set_data("is there anybody out there?"); $doc->add_term("XYzzy"); $doc->add_posting($stem->apply("is"), 1); $doc->add_posting($stem->apply("there"), 2); $doc->add_posting($stem->apply("anybody"), 3); $doc->add_posting($stem->apply("out"), 4); $doc->add_posting($stem->apply("there"), 5); // Check virtual function dispatch. if (substr($db->get_description(), 0, 17) !== "WritableDatabase(") { print "Unexpected \$db->get_description()\n"; exit(1); } $db->add_document($doc); if ($db->get_doccount() != 1) { print "Unexpected \$db->get_doccount()\n"; exit(1); } $terms = array("smoke", "test", "terms"); $query = new XapianQuery(XapianQuery::OP_OR, $terms); if ($query->get_description() != "Query((smoke OR test OR terms))") { print "Unexpected \$query->get_description()\n"; exit(1); } $query1 = new XapianQuery(XapianQuery::OP_PHRASE, array("smoke", "test", "tuple")); if ($query1->get_description() != "Query((smoke PHRASE 3 test PHRASE 3 tuple))") { print "Unexpected \$query1->get_description()\n"; exit(1); } $query1b = new XapianQuery(XapianQuery::OP_NEAR, array("smoke", "test", "tuple"), 4);