X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fsbin%2Frt-setup-fulltext-index;h=e27a270104a43b361614a5c25efd74fbff420a8b;hb=ed1f84b4e8f626245995ecda5afcf83092c153b2;hp=8625815441fa7c181cdd78451c5f5325c2ff77e2;hpb=85e677b86fc37c54e6de2b06340351a28f5a5916;p=freeside.git diff --git a/rt/sbin/rt-setup-fulltext-index b/rt/sbin/rt-setup-fulltext-index index 862581544..e27a27010 100755 --- a/rt/sbin/rt-setup-fulltext-index +++ b/rt/sbin/rt-setup-fulltext-index @@ -3,7 +3,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -146,10 +146,16 @@ if ( $DB{'type'} eq 'mysql' ) { default => $DEFAULT{'table'}, silent => !$OPT{'ask'}, ); - my $url = $OPT{'url'} || prompt( + + my $url = 'sphinx://localhost:3312/rt'; + my $version = ($dbh->selectrow_array("show variables like 'version'"))[1]; + $url = 'sphinx://127.0.0.1:3312/rt' + if $version and $version =~ /^(\d+\.\d+)/ and $1 >= 5.5; + + $url = $OPT{'url'} || prompt( message => "Enter URL of the sphinx search server; this should be of the form\n" . "sphinx://:/", - default => 'sphinx://localhost:3312/rt', + default => $url, silent => !$OPT{'ask'}, ); my $maxmatches = $OPT{'maxmatches'} || prompt(