Show
Ignore:
Timestamp:
05/11/08 17:04:41 (4 years ago)
Author:
dom
Message:

fix much tab/whitespace damage; no functional changes.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wiki-toolkit/trunk/lib/Wiki/Toolkit/Setup/DBIxFTSMySQL.pm

    r209 r431  
    3737 
    3838sub setup { 
    39   my $dbh = _get_dbh( @_ ); 
     39    my $dbh = _get_dbh( @_ ); 
    4040 
    41   # Drop FTS indexes if they already exist. 
    42   my $fts = DBIx::FullTextSearch->open($dbh, "_content_and_title_fts"); 
    43   $fts->drop if $fts; 
    44   $fts = DBIx::FullTextSearch->open($dbh, "_title_fts"); 
    45   $fts->drop if $fts; 
     41    # Drop FTS indexes if they already exist. 
     42    my $fts = DBIx::FullTextSearch->open($dbh, "_content_and_title_fts"); 
     43    $fts->drop if $fts; 
     44    $fts = DBIx::FullTextSearch->open($dbh, "_title_fts"); 
     45    $fts->drop if $fts; 
    4646 
    47   # Set up FullText indexes and index anything already extant. 
    48   my $fts_all = DBIx::FullTextSearch->create($dbh, "_content_and_title_fts", 
    49                                              frontend       => "table", 
    50                                              backend        => "phrase", 
    51                                              table_name     => "node", 
    52                                              column_name    => ["name","text"], 
    53                                              column_id_name => "name", 
    54                                              stemmer        => "en-uk"); 
     47    # Set up FullText indexes and index anything already extant. 
     48    my $fts_all = DBIx::FullTextSearch->create($dbh, "_content_and_title_fts", 
     49                         frontend       => "table", 
     50                         backend        => "phrase", 
     51                         table_name     => "node", 
     52                         column_name    => ["name","text"], 
     53                         column_id_name => "name", 
     54                         stemmer        => "en-uk"); 
    5555 
    56   my $fts_title = DBIx::FullTextSearch->create($dbh, "_title_fts", 
    57                                                frontend       => "table", 
    58                                                backend        => "phrase", 
    59                                                table_name     => "node", 
    60                                                column_name    => "name", 
    61                                                column_id_name => "name", 
    62                                                stemmer        => "en-uk"); 
     56    my $fts_title = DBIx::FullTextSearch->create($dbh, "_title_fts", 
     57                         frontend       => "table", 
     58                         backend        => "phrase", 
     59                         table_name     => "node", 
     60                         column_name    => "name", 
     61                         column_id_name => "name", 
     62                         stemmer        => "en-uk"); 
    6363 
    64   my $sql = "SELECT name FROM node"; 
    65   my $sth = $dbh->prepare($sql); 
    66   $sth->execute(); 
    67   while (my ($name, $version) = $sth->fetchrow_array) { 
    68     $fts_title->index_document($name); 
    69     $fts_all->index_document($name); 
    70   } 
    71   $sth->finish; 
     64    my $sql = "SELECT name FROM node"; 
     65    my $sth = $dbh->prepare($sql); 
     66    $sth->execute(); 
     67    while (my ($name, $version) = $sth->fetchrow_array) { 
     68        $fts_title->index_document($name); 
     69        $fts_all->index_document($name); 
     70    } 
     71    $sth->finish; 
    7272} 
    7373 
     
    7878    $dsn .= ";host=$dbhost" if $dbhost; 
    7979    my $dbh = DBI->connect($dsn, $dbuser, $dbpass, 
    80                            { PrintError => 1, RaiseError => 1, 
    81                              AutoCommit => 1 } ) 
    82       or croak DBI::errstr; 
     80               { PrintError => 1, RaiseError => 1, 
     81                 AutoCommit => 1 } ) 
     82        or croak DBI::errstr; 
    8383    return $dbh; 
    8484}