[Xapian-discuss] Re: PHP searches - not figuring it out
Andrey
alpha04 at netvigator.com
Thu Feb 8 03:26:41 GMT 2007
some testing codes which is working
$db = new XapianDatabase("x/xxx_flint", DB_OPEN);
$op_or = XapianQuery::OP_OR;
$query1=new XapianQuery(array("term1","term2","term3")); << forgot if
correct
$query2=new XapianQuery("heavy_term",10);
$query = new XapianQuery($op_or,$query1,$query2);
$enq = new XapianEnquire($db);
$enq->set_query($query);
$enq->set_docid_order("Enquire_ASCENDING");
$mset = $enq->get_mset($start, $num_result_per_page);
$mseti = $mset->begin();
while (!$mseti->equals($mset->end())) {
$result[$i]['terms'] = join(" ", $enq->get_matching_terms($mseti));
$result[$i]['id'] = $mseti->get_docid();
$result[$i]['percent'] =$mseti->get_percent();
$odoc = $mseti->get_document();
$result[$i]['data'] = $odoc->get_data();
$mseti->next();
$i++;
}
More information about the Xapian-discuss
mailing list