summaryrefslogtreecommitdiff
path: root/search
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-08 03:22:10 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-08 03:22:10 +0100
commitd57f244f5bf0ab7e86446d0088079fbd008d13df (patch)
tree538a710e62effd118617728ca86ba18bcb3ded9d /search
parent192abb9db60f95968953b515ce18700c6b2da090 (diff)
building search index w/ old perl lib
Diffstat (limited to 'search')
-rwxr-xr-xsearch/bin/build-index12
-rwxr-xr-xsearch/bin/poetaster33
-rw-r--r--search/lib/Bucky/DB.pm4
-rw-r--r--search/lib/Bucky/Search.pm2
4 files changed, 9 insertions, 42 deletions
diff --git a/search/bin/build-index b/search/bin/build-index
index b838924..02866d1 100755
--- a/search/bin/build-index
+++ b/search/bin/build-index
@@ -1,6 +1,6 @@
#!/usr/bin/perl
use strict;
-use lib "../lib";
+use lib "./search/lib";
use Bucky;
use DB_File;
#require Time::Stopwatch;
@@ -50,11 +50,11 @@ my $file = $bucky->index_filename;
print_timer($timer, "Dumped $file");
-print "NEW: " ; system("/bin/ls", "-l", "./$file");
-print "OLD: " ; system("/bin/ls", "-l", "../cgi-bin/$file");
-system("/bin/mv", "../cgi-bin/$file", "../cgi-bin/$file.1");
-system("/bin/cp", "./$file", "../cgi-bin/$file");
-system("/usr/bin/perl", "./build-autocomplete");
+system("/bin/mv", "search.db", "search.db.1");
+system("/bin/mv", "$file", "search.db");
+print "OLD: " ; system("/bin/ls", "-l", "./search.db.1");
+print "NEW: " ; system("/bin/ls", "-l", "./search.db");
+# system("/usr/bin/perl", "./build-autocomplete");
exit;
sub parse_terms
diff --git a/search/bin/poetaster b/search/bin/poetaster
deleted file mode 100755
index fe973a5..0000000
--- a/search/bin/poetaster
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/perl
-use lib "../lib";
-use Rest;
-use CGI;
-use Poetaster;
-
-my $file = $ARGV[0] || "twain";
-my $data = load_data($file);
-$data =~ s/<[^>]+>//g;
-$data =~ s/\r\n/ /g;
-$data =~ s/\s+/ /g;
-$data =~ s/\. \. \. /... /g;
-my $self = new Poetaster;
-my $poem = $self->poem($data);
-print $poem;
-
-sub load_data
- {
- my ($file) = @_;
- my $data = '';
- if ($file =~ /^http/)
- {
- $data = Rest->new->rest_get_raw($file);
- }
- else
- {
- local $/;
- open F, $file;
- $data = <F>;
- close F;
- }
- return $data;
- }
diff --git a/search/lib/Bucky/DB.pm b/search/lib/Bucky/DB.pm
index 1e33b32..1f0f99e 100644
--- a/search/lib/Bucky/DB.pm
+++ b/search/lib/Bucky/DB.pm
@@ -166,10 +166,10 @@ sub dsn
return $self->{_dsn};
}
sub db_name
- { 'bucky' }
+ { 'bucky3' }
sub db_host
{ 'localhost' }
sub my_cnf
- { '/var/www/vhosts/carbonpictures.com/.my.cnf' }
+ { './.my.cnf' }
1;
diff --git a/search/lib/Bucky/Search.pm b/search/lib/Bucky/Search.pm
index e01d55a..c3516a1 100644
--- a/search/lib/Bucky/Search.pm
+++ b/search/lib/Bucky/Search.pm
@@ -32,7 +32,7 @@ sub index_close
untie %$index;
}
sub index_filename
- { "gross.db" }
+ { "search_init.db" }
sub auto_index
{
my ($self, $auto_index) = @_;