Taxi::Mysql::HitList - extendable full-text index using mysql: list of hits


NAME

Taxi::Mysql::HitList - extendable full-text index using mysql: list of hits

(Back to Top)


SYNOPSIS

 ##========================================================================
 ## 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();

(Back to Top)


DESCRIPTION

Globals etc.

Variable: @ISA

Taxi::Mysql::HitList inherits from Taxi::Mysql::Base.

Constructors etc.

new
 $hl = $CLASS_OR_OBJ->new($subclass, %args);

Object structure / keyword %args:

   {
    ##-- Source data
    query => $query,
    ##-- Hit data
    hits=>\@list_of_hits,
    populated=>$bool,
   }
clear
 undef = $hl->clear;

Clears the HitList object.

empty
 $bool = $hl->empty();

Returns true iff the HitList object is empty (contains no hits).

size
 $nhits = $hl->size();

Returns the number of hits in the HitList object.

Manipulation

push
 undef = $hl->push(@hits);

Add additional Taxi::Mysql::Hit objects @hits to the HitList $hl. Should only be called for pre-populated @hits.

populate
 $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.

ensurePopulated
 $bool = $hl->ensurePopulated();

Useful alias to ensure that a HitList is populated. Unsurprisingly, $hl->{query} must be defined for this to work.

(Back to Top)


ACKNOWLEDGEMENTS

Perl by Larry Wall.

(Back to Top)


AUTHOR

Bryan Jurish <moocow@ling.uni-potsdam.de>

(Back to Top)


COPYRIGHT AND LICENSE

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.

(Back to Top)


SEE ALSO

perl(1), Taxi::Mysql(3perl), Taxi::Mysql::Hit(3perl), Taxi::Mysql::Query::Base(3perl), Taxi::Mysql::Format(3perl).

(Back to Top)

 Taxi::Mysql::HitList - extendable full-text index using mysql: list of hits