[Bio] / Sprout / ERDB.pm Repository:
ViewVC logotype

Diff of /Sprout/ERDB.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.80, Thu Nov 30 23:04:01 2006 UTC revision 1.81, Wed Dec 20 20:03:25 2006 UTC
# Line 2585  Line 2585 
2585              # The full-text index (if any) is always built last, even for MySQL.              # The full-text index (if any) is always built last, even for MySQL.
2586              # First we need to see if this table has a full-text index. Only              # First we need to see if this table has a full-text index. Only
2587              # primary relations are allowed that privilege.              # primary relations are allowed that privilege.
2588                Trace("Checking for full-text index on $relationName.") if T(2);
2589              if ($self->_IsPrimary($relationName)) {              if ($self->_IsPrimary($relationName)) {
2590                  # Get the relation's entity/relationship structure.                  # Get the relation's entity/relationship structure.
2591                  my $structure = $self->_GetStructure($relationName);                  my $structure = $self->_GetStructure($relationName);
2592                    Trace("Checking for search fields in $relationName.") if T(3);
2593                  # Check for a searchable fields list.                  # Check for a searchable fields list.
2594                  if (exists $structure->{searchFields}) {                  if (exists $structure->{searchFields}) {
2595                      # Here we know that we need to create a full-text search index.                      # Here we know that we need to create a full-text search index.
2596                      # Get an SQL-formatted field name list.                      # Get an SQL-formatted field name list.
2597                      my $fields = join(", ", $self->_FixNames(@{$structure->{searchFields}}));                      my $fields = join(", ", _FixNames(@{$structure->{searchFields}}));
2598                      # Create the index.                      # Create the index.
2599                      $dbh->create_index(tbl => $relationName, idx => "search_idx",                      $dbh->create_index(tbl => $relationName, idx => "search_idx",
2600                                         flds => $fields, kind => 'fulltext');                                         flds => $fields, kind => 'fulltext');
2601                        Trace("Index created for $fields in $relationName.") if T(2);
2602                  }                  }
2603              }              }
2604          }          }

Legend:
Removed from v.1.80  
changed lines
  Added in v.1.81

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3