Dezi::Aggregator::DBI - index DB records with Swish-e
use Dezi::Aggregator::DBI; use Carp; my $aggregator = Dezi::Aggregator::DBI->new( db => [ "DBI:mysql:database=movies;host=localhost;port=3306", 'some_user', 'some_secret_pass', { RaiseError => 1, HandleError => sub { confess(shift) }, } ], schema => { 'moviesIlike' => { title => {type => 'char', bias => 1}, synopsis => {type => 'char', bias => 1}, year => {type => 'int', bias => 1}, director => {type => 'char', bias => 1}, producer => {type => 'char', bias => 1}, awards => {type => 'char', bias => 1}, date => {type => 'date', bias => 1}, swishdescription => { synopsis => 1, producer => 1 }, swishtitle => 'title', } } use_quotes => 1, quote_char => '`', # backtick alias_columns => 1, indexer => Dezi::Indexer::Native->new, ); $aggregator->crawl();
Dezi::Aggregator::DBI is a Dezi::Aggregator subclass designed for providing full-text search for databases.
Since Dezi::Aggregator::DBI inherits from Dezi::Aggregator, read that documentation first. Any overridden methods are documented here.
Create new aggregator object.
The following opts are required:
connect_info is passed directly to DBI's connect() method, so see the DBI docs for syntax. If connect_info is a DBI handle object, it is accepted as is. If connect_info is an array ref, it will be dereferenced and passed to connect(). Otherwise it will be passed to connect as is.
db_schema is a hashref of table names and column descriptions. Each key should be a table name. Each value should be a hashref of column descriptions, where the key is the column name and the value is a hashref of type and bias. See the SYNOPSIS.
There are two special column names: swishtitle and swishdescription. These are reserved for mapping real column names to Swish-e property names for returning in search results. swishtitle should be the name of a column, and swishdescription should be a hashref of column names to include in the StoreDescription value.
swishtitle
swishdescription
A Dezi::Indexer-derived object.
The following opts are optional:
The alias_columns flag indicates whether all columns should be searchable under the default MetaName of swishdefault. The default is 1 (true). This is not the default behaviour of swish-e; this is a feature of Dezi.
alias_columns
swishdefault
Boolean indicating whether column and table names should be quoted. This is typically DBD-specific (e.g., MySQL requires this be true). Default is true.
The character to use when use_quotes is true. Default is ` (backtick).
use_quotes
NOTE: The new() method simply inherits from Dezi::Aggregator, so any params valid for that method are allowed here.
Internal method called by new().
Create index.
Returns number of rows indexed.
Peter Karman, <karpet@dezi.org>
Please report any bugs or feature requests to bug-dezi-app 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-dezi-app at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Dezi::App
You can also look for information at:
Website
http://dezi.org/
IRC
#dezisearch at freenode
Mailing list
https://groups.google.com/forum/#!forum/dezi-search
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
https://metacpan.org/dist/Dezi-App/
Copyright 2014 by Peter Karman
This library is free software; you can redistribute it and/or modify it under the terms of the GPL v2 or later.
http://dezi.org/, http://swish-e.org/, http://lucy.apache.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.