NAME

OpenInteract2::FullTextIterator - Iterator to scroll through search results

SYNOPSIS

my $indexer = CTX->fulltext_indexer;
my $iterator = $indexer->search_index({
    terms        => [ 'mario', 'lemieux' ],
    search_type  => 'and',
    return       => 'iterator'
});

# just get the object...
while ( my $obj = $iter->get_next ) {
    print "Object is a ", ref( $obj ), " with ID ", $obj->id, "\n";
}

# ...or get additional information as well
while ( my ( $obj, $count, $score ) = $iter->get_next ) {
    print "Object #$count is a ", ref( $obj ), " with ID ", $obj->id, " ",
          "and search score $score\n";
}

DESCRIPTION

This class implements SPOPS::Iterator so we can scroll through search results one at a time. The results do not have to be SPOPS objects but they do need to implement fetch( $id ) as a class method to return a new object.

METHODS

initialize

See our instance properties:

  • results: Arrayref of results as generated by OpenInteract2::ResultsManage or something similar.

  • min: Start returning objects at this place number.

  • max: Stop returning objects at this place number.

fetch_object

Return the next object.

SEE ALSO

SPOPS::Iterator

OpenInteract2::FullTextIndexer

COPYRIGHT

Copyright (c) 2001-2004 Chris Winters. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS

Chris Winters <chris@cwinters.com>