[Xapian-discuss] PHP and Enquire_get_eset

InsaneToucan insanetoucan at gmail.com
Fri Dec 15 20:11:39 GMT 2006


get_termname does not work either (it fatals in the same manner).

On 12/15/06, InsaneToucan <insanetoucan at gmail.com> wrote:
>
> Fatal error: Call to a member function get_term_name() on a non-object in
> /var/www/john/htdocs/simplesearch.php on line 61
>
> On 12/15/06, James Aylett < james-xapian at tartarus.org> wrote:
> >
> > On Fri, Dec 15, 2006 at 11:22:54AM -0600, InsaneToucan wrote:
> >
> > > Message got cut off, I tried:
> > >
> > >        $rset = new XapianRSet();
> > >        $rset->add_document($mseti->get_docid());
> > >        $eset = $enquire->get_eset(10, $rset);
> > >        $sets = $eset->begin();
> > >        foreach($sets as $val) {
> > >                var_dump($val);
> > >        }
> > >
> > > Which just outputs:
> > >
> > > Performing query `Xapian::Query(php)'
> > > 8 results found
> > > <snip>
> > > resource(21) of type (_p_Xapian__ESetIterator)
> > >
> > > I simply want to get the related terms.
> >
> > $val in your foreach loop is a wrapped Xapian::ESetIterator. In the
> > wrapping, run get_termname() to get the relevant term:
> >
> > foreach ($sets as $val) {
> >         var_dump($val->get_term_name());
> > }
> >
> > J
> >
> > --
> >
> > /--------------------------------------------------------------------------\
> >   James Aylett
> > xapian.org
> >   james at tartarus.org
> > uncertaintydivision.org
> >
>
>


More information about the Xapian-discuss mailing list