/[swish]/trunk/html/swish.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/html/swish.cgi

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

revision 21 by dpavlin, Tue Mar 18 20:20:11 2003 UTC revision 23 by dpavlin, Fri Mar 21 21:10:51 2003 UTC
# Line 41  foreach (@{$config->{labels}->{label}}) Line 41  foreach (@{$config->{labels}->{label}})
41          $labels{$_->{value}} = x($_->{content});          $labels{$_->{value}} = x($_->{content});
42  }  }
43    
44    my $path = param('path');       # limit to this path
45    my %path_label;
46    my @path_name;
47    foreach (@{$config->{paths}->{path}}) {
48            push @path_name,x($_->{limit});
49            $path_label{$_->{limit}} = x($_->{content});
50    }
51    
52  if ($config->{charset}) {  if ($config->{charset}) {
53          print header(-charset=>x($config->{charset}));          print header(-charset=>x($config->{charset}));
54  } else {  } else {
# Line 53  print x($config->{text}->{documents}); Line 61  print x($config->{text}->{documents});
61  print textfield('search');  print textfield('search');
62  print submit(-value=> x($config->{text}->{submit}));  print submit(-value=> x($config->{text}->{submit}));
63  print checkbox(-name=>'no_affix', -checked=>0, -label=>x($config->{text}->{no_spell})) if ($spelling_alt);  print checkbox(-name=>'no_affix', -checked=>0, -label=>x($config->{text}->{no_spell})) if ($spelling_alt);
64    if (@path_name) {
65            print br,x($config->{text}->{limit});
66            print popup_menu(-name=>'path',-values=>\@path_name,-labels=>\%path_label,-default=>$path);
67    }
68  print end_form,hr;  print end_form,hr;
69    
70  if (param('search')) {  if (param('search')) {
# Line 95  if (param('search')) { Line 107  if (param('search')) {
107          $s=~tr/¹©ðÐèÈæƾ®/sSdDcCcCzZ/;          $s=~tr/¹©ðÐèÈæƾ®/sSdDcCcCzZ/;
108          $s=~s/\*\*+/*/g;          $s=~s/\*\*+/*/g;
109    
110            # limit to some path
111            $s = "swishdocpath=($path) and $s" if ($path);
112    
113            my %params;     # optional parametars for swish
114    
115          my @properties = split(/\s+/,x($config->{properties}));          my @properties = split(/\s+/,x($config->{properties}));
116            $params{properties} = \@properties if (@properties);
117    
118          my $sh = SWISH->connect('Fork',          my $sh = SWISH->connect('Fork',
119                  prog     => x($config->{prog}),                  prog     => x($config->{prog}),
120                  indexes  => x($config->{index}),                  indexes  => x($config->{index}),
                 properties  => \@properties,  
121                  results  => sub {                  results  => sub {
122                          my ($sh,$hit) = @_;                          my ($sh,$hit) = @_;
123    
# Line 119  if (param('search')) { Line 136  if (param('search')) {
136  #                       print "Field '$_' = '", $hit->$_, "'<br>\n" for sort @fields;  #                       print "Field '$_' = '", $hit->$_, "'<br>\n" for sort @fields;
137                  },                  },
138                  maxhits => param('max_hits') || $max_hits,                  maxhits => param('max_hits') || $max_hits,
139                    \%params,
140          );          );
141    
142          die $SWISH::errstr unless $sh;          die $SWISH::errstr unless $sh;

Legend:
Removed from v.21  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.26