Parent Directory | Revision Log
Major code update: 0.9-rc3 if no serious problems are found, this will become first public version (0.9). - search.pl is working again - fixed Mail::Box problem with unimplemented lock_type => 'none' on Maildir - documented Mozilla 1.5 problem with sidebar float: right - don't output anything from swish-e while indexing - remove (e-mail) from addresses (it seems that Exchange like to add those) - added progress report while indexing - documented all command-line utilities
1 | #!/usr/bin/perl -w |
2 | |
3 | BEGIN { |
4 | my $basedir = readlink($0) || $0; $basedir =~ s#/[^/]+$##; |
5 | unshift(@INC, $basedir); |
6 | } |
7 | |
8 | =head1 NAME |
9 | |
10 | search.pl - command-line search utility |
11 | |
12 | =head1 SYNOPSYS |
13 | |
14 | search.pl [local.conf] 'subject:nice demo' |
15 | |
16 | =head1 DESCRIPTION |
17 | |
18 | This utility is useful mainly for debugging, but you can try quick-searches |
19 | using it. |
20 | |
21 | =cut |
22 | |
23 | use Data::Dumper; |
24 | use MWS::SWISH; |
25 | use Template; |
26 | |
27 | my $debug = 1; |
28 | |
29 | my $s = shift @ARGV; |
30 | |
31 | my $config_file = 'global.conf'; |
32 | if (-f $s) { |
33 | $config_file = $s; |
34 | # print STDERR "using $config_file\n"; |
35 | $s = ''; |
36 | } |
37 | |
38 | my $mws = MWS::SWISH->new(config_file=>$config_file); |
39 | |
40 | $s.=join(" ",@ARGV); |
41 | |
42 | my $results = $mws->search($s); |
43 | print "$results results...\n"; |
44 | |
45 | my $t = Template->new({ |
46 | INCLUDE_PATH => $mws->{config}->val('global', 'templates'), |
47 | }); |
48 | |
49 | my @res = $mws->fetch_all_results(); |
50 | |
51 | $t->process("results.txt", { |
52 | query => $s, |
53 | results => \@res, |
54 | }) || die $t->error(); |
55 |
Name | Value |
---|---|
svn:executable |
ViewVC Help | |
Powered by ViewVC 1.1.26 |