-
-
Save c93614/807de04e93ede7c7b33b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$posting = $database->postlist_begin( $search_id ); | |
$enquire = new XapianEnquire( $database ); | |
$rset = new XapianRset(); | |
$rset->add_document( $posting->get_docid() ); | |
$eset = $enquire->get_eset(20, $rset); | |
$i = $eset->begin(); | |
$terms = array(); | |
while ( !$i->equals($eset->end()) ) { | |
$terms[] = $i->get_term(); | |
$i->next(); | |
} | |
$query = new XapianQuery( XapianQuery::OP_OR, $terms ); | |
$enquire->set_query( $query ); | |
$matches = $enquire->get_mset( 0, $max_recommended+1 ); | |
$ids = array(); | |
$i = $matches->begin(); | |
while ( !$i->equals($matches->end()) ) { | |
$n = $i->get_rank() + 1; | |
if( $i->get_document()->get_value( $field_id ) != $post->id ) { | |
$ids[] = $i->get_document()->get_value( $field_id ); | |
} | |
$i->next(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment