2 Oct 12:22
Howto use the term iterator?
John Wards <jwards <at> whiteoctober.co.uk>
2008-10-02 10:22:18 GMT
2008-10-02 10:22:18 GMT
Hello,
I am scratching my head at how to use the term iterator in PHP.
I would like to know what terms are stored against a document.
I have a document called $odoc like so coming from some matches.
$i = $matches->begin();
while (!$i->equals($matches->end())) {
$n = $i->get_rank() + 1;
$odoc = $i->get_document();
$data = $odoc->get_data();
$i->next();
}
How do I use the termiterator returned from:
$odoc->termlist_begin();
I have tried foreaching on it and that doesn't work. I have tried using
reflection to see if I am missing something and found a "next" method.
But again I can't seem to get that to work either.
Some simple example code would be great!
I was only needing this for debugging a document and found "delve" which
does the job, but I don't like to be beaten on this one...
Cheers
(Continue reading)
RSS Feed