[Rt-commit] rt branch, 4.2/mysql-native-fts, repushed
Alex Vandiver
alexmv at bestpractical.com
Tue Jul 29 13:09:27 EDT 2014
The branch 4.2/mysql-native-fts was deleted and repushed:
was 1218b28a333e6603fe925b09866e1c385606f985
now b490888fd9527edb9c5340ae492251e3ba08a410
1: e83914b = 1: ff018f3 Add additional clarification points about Sphinx on MySQL
--: ------- > 2: 7d52ea3 Drop sphinx xmlpipe2 output, which was unusable and undocumented
--: ------- > 3: 3152f64 Drop finalize and clean functions, which are now unused
2: f1a2059 = 4: fd038d9 Rename Sphinx FTS search
3: 1d91cb6 ! 5: 2374496 Support native FTS on MySQL 5.6 and above
@@ -168,86 +168,33 @@
--- a/sbin/rt-fulltext-indexer.in
+++ b/sbin/rt-fulltext-indexer.in
@@
- my @OPT_LIST = qw(help|h! debug!);
-
- my $db_type = RT->Config->Get('DatabaseType');
--if ( $db_type eq 'Pg' ) {
-+my $fts_config = RT->Config->Get('FullTextSearch') || {};
-+if ($fts_config->{Sphinx}) {
+ );
+ push @OPT_LIST, 'limit=i', 'all!';
+ }
++elsif ( $db_type eq 'mysql' ) {
+ %OPT = (
+ %OPT,
+ limit => 0,
+ all => 0,
-+ xmlpipe2 => 0,
+ );
-+ push @OPT_LIST, 'limit=i', 'all!', 'xmlpipe2!';
-+ $db_type = 'sphinx';
-+} elsif ( $db_type eq 'Pg' ) {
++ push @OPT_LIST, 'limit=i', 'all!';
++}
+ elsif ( $db_type eq 'Oracle' ) {
%OPT = (
%OPT,
- limit => 0,
-@@
- %OPT,
- limit => 0,
- all => 0,
-- xmlpipe2 => 0,
- );
-- push @OPT_LIST, 'limit=i', 'all!', 'xmlpipe2!';
-+ push @OPT_LIST, 'limit=i', 'all!';
- }
- elsif ( $db_type eq 'Oracle' ) {
- %OPT = (
-@@
- );
- }
-
--my $fts_config = RT->Config->Get('FullTextSearch') || {};
- unless ( $fts_config->{'Enable'} ) {
- print STDERR <<EOT;
-
@@
$index, $OPT{'memory'}
);
exit;
-} elsif ( $db_type eq 'mysql' ) {
-+} elsif ( $db_type eq 'sphinx' ) {
- unless ($OPT{'xmlpipe2'}) {
- print STDERR <<EOT;
-
-@@
++} elsif ( $fts_config->{Sphinx} ) {
+ print STDERR <<EOT;
+
+ Updates to the external Sphinx index are done via running the sphinx
+@@
+ );
}
- {
--sub last_indexed_mysql {
-+sub last_indexed_sphinx {
- my $type = shift;
- my $attr = $RT::System->FirstAttribute('LastIndexedAttachments');
- return 0 unless $attr;
-@@
- return $attr->{ $type } || 0;
- }
-
--sub process_mysql {
-+sub process_sphinx {
- my ($type, $attachment, $text) = (@_);
-
- my $doc = sphinx_template();
-@@
- return $doc;
- }
-
--sub finalize_mysql {
-+sub finalize_sphinx {
- my ($type, $attachments) = @_;
- sphinx_template()->toFH(*STDOUT, 1);
- }
-
--sub clean_mysql {
-+sub clean_sphinx {
- $doc = undef;
- }
-+}
-+
+sub last_indexed_mysql { last_indexed_pg(@_); }
+sub process_mysql {
+ my ($type, $attachment, $text) = (@_);
@@ -261,11 +208,13 @@
+ } else {
+ $query = "INSERT INTO $table(Content, id) VALUES(?, ?)";
+ }
-
++
+ $dbh->do( $query, undef, $$text, $attachment->id );
- }
-
++}
++
sub last_indexed_pg {
+ my $type = shift;
+ my $attachments = attachments( $type );
diff --git a/sbin/rt-setup-fulltext-index.in b/sbin/rt-setup-fulltext-index.in
--- a/sbin/rt-setup-fulltext-index.in
4: 1218b28 ! 6: bfd8dce Using a separate MyISAM table, we can also support FTS on MySQL < 5.6
@@ -153,3 +153,4 @@
run_tests(
"Content LIKE 'book'" => { book => 1, bar => 0 },
"Content LIKE 'bar'" => { book => 0, bar => 1 },
+
--: ------- > 7: a4e5362 extract_text and extract_html are identical; inline them
--: ------- > 8: 2474f53 Inline the differences between text/plain and text/html attachment lists
--: ------- > 9: b276cbe Stop skipping indexing of text/html within multipart/alternative
--: ------- > 10: b3bf43a Use the new, shorterm initialization form
--: ------- > 11: 06e22fe Simplify and condense option parsing
--: ------- > 12: 5b8ed2a Documentation has moved out; update --help accordingly
--: ------- > 13: b06fef2 Remove AUTHOR section; it is unnecessary in core sbin files
--: ------- > 14: 929539a Skipping ACL checks yields a sizable performance increase
--: ------- > 15: 434556b Index attachments in one pass through the database, not two
--: ------- > 16: 1f70512 Index attachments even on deleted tickets
--: ------- > 17: f9c8eae mysql and pg share the same last_indexed; unify the method
--: ------- > 18: b01e737 Replace the last use of goto_specific with explicit function calls
--: ------- > 19: c876f7c Simplify last_indexed
--: ------- > 20: 5c56ed6 Only call last_indexed once, as it may be heavy
--: ------- > 21: 6768ac5 Index even empty attachments
--: ------- > 22: acb1782 As last_indexed is based on the highest insert, there will never be an UPDATE needed
--: ------- > 23: d2ddcbe Inversion of control
--: ------- > 24: 7a29799 Switch to preparing statements, rather than just setting strings
--: ------- > 25: 7d78413 INSERT DELAYED provides notable speed benefits on MyISAM
--: ------- > 26: b490888 Improve MySQL insert speed by batching inserts into one statement
More information about the rt-commit
mailing list