Taxi::Mysql::HitList - extendable full-text index using mysql: list of hits |
Taxi::Mysql::HitList - extendable full-text index using mysql: list of hits
##======================================================================== ## PRELIMINARIES
use Taxi::Mysql::HitList;
##======================================================================== ## Constructors etc.
$hl = $CLASS_OR_OBJ->new($subclass, %args); $undef = $hl->clear; $bool = $hl->empty(); $nhits = $hl->size();
##======================================================================== ## Manipulation
$undef = $hl->push(@hits); $hl_or_undef = $hl->populate($query, %hitArgs); $bool = $hl->ensurePopulated();
Taxi::Mysql::HitList inherits from Taxi::Mysql::Base.
$hl = $CLASS_OR_OBJ->new($subclass, %args);
Object structure / keyword %args:
{ ##-- Source data query => $query,
##-- Hit data hits=>\@list_of_hits, populated=>$bool, }
undef = $hl->clear;
Clears the HitList object.
$bool = $hl->empty();
Returns true iff the HitList object is empty (contains no hits).
$nhits = $hl->size();
Returns the number of hits in the HitList object.
undef = $hl->push(@hits);
Add additional Taxi::Mysql::Hit objects @hits to the HitList $hl. Should only be called for pre-populated @hits.
$hl_or_undef = $hl->populate($query, %hitArgs);
Populates a hit list from a Taxi::Mysql::Query::Base object $query.
This method iterates over the rows returned by the $query backend
statement handle and creates and populates a hit (via $query->fetchHit())
for each such row.
If specified, %hitArgs shold contain additional arguments to be passed to
$query->fetchHit().
Returns true on success, false otherwise. Sets $hl->{populated} accordingly.
$bool = $hl->ensurePopulated();
Useful alias to ensure that a HitList is populated. Unsurprisingly, $hl->{query} must be defined for this to work.
Perl by Larry Wall.
Bryan Jurish <moocow@ling.uni-potsdam.de>
Copyright (C) 2006 by Bryan Jurish
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
perl(1), Taxi::Mysql(3perl), Taxi::Mysql::Hit(3perl), Taxi::Mysql::Query::Base(3perl), Taxi::Mysql::Format(3perl).
Taxi::Mysql::HitList - extendable full-text index using mysql: list of hits |