Dezi::Indexer::Doc - Document object class for passing to Dezi::Indexer
# subclass Dezi::Indexer::Doc # and override filter() method package MyDoc; use Moose; extends 'Dezi::Indexer::Doc'; sub filter { my $doc = shift; # alter url my $url = $doc->url; $url =~ s/my.foo.com/my.bar.org/; $doc->url( $url ); # alter content my $buf = $doc->content; $buf =~ s/foo/bar/gi; $doc->content( $buf ); } 1;
Dezi::Indexer::Doc is the base class for Doc objects in the Dezi framework. Doc objects are created by Dezi::Aggregator classes and processed by Dezi::Indexer classes.
You can subclass Dezi::Indexer::Doc and add a filter() method to alter the values of the Doc object before it is indexed.
All of the following methods may be overridden when subclassing this module, but the recommendation is to override only filter().
Instantiate Doc object.
All of the following params are also available as accessors/mutators.
Note that the charset is derived from the LC_CTYPE environment variable.
A hashref.
Swish-e 2.x or Swish3 style headers. Value should be 2 or 3. Default is 3.
2
3
Calls filter() on object.
Override this method to alter the values in the object prior to it being process()ed by the Indexer.
The default is to do nothing.
This method can also be set using the filter() callback in Dezi::App->new().
Return the Doc object rendered as a scalar string, ready to be indexed. This will include the proper headers. See SWISH::3::Headers.
NOTE: as_string() is also used if you use a Doc object as a string. Example:
print $doc->as_string; # one way print $doc; # same thing
Peter Karman, <perl@peknet.com>
Please report any bugs or feature requests to bug-swish-prog at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dezi-App. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-swish-prog at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Dezi
You can also look for information at:
Mailing list
http://lists.swish-e.org/listinfo/users
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dezi-App
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Dezi-App
CPAN Ratings
http://cpanratings.perl.org/d/Dezi-App
Search CPAN
http://search.cpan.org/dist/Dezi-App/
Copyright 2008-2018 by Peter Karman
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://swish-e.org/
To install Dezi::App, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dezi::App
CPAN shell
perl -MCPAN -e shell install Dezi::App
For more information on module installation, please visit the detailed CPAN module installation guide.