/[webpac2]/Webpacus/lib/Webpacus/Controller/Search.pm
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 /Webpacus/lib/Webpacus/Controller/Search.pm

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

revision 312 by dpavlin, Sat Dec 17 23:41:10 2005 UTC revision 313 by dpavlin, Wed Dec 21 22:18:56 2005 UTC
# Line 118  in name. Line 118  in name.
118    
119  # specify all Hyper Estraier operators which should stop this module  # specify all Hyper Estraier operators which should stop this module
120  # from splitting search query and joining it with default operator  # from splitting search query and joining it with default operator
121  my $hest_op_regex = qr/(:?\[(:?BW|EW|RX)\]|AND|OR|ANDNOT)/o;  my $hest_op_regex = '(:?\[(:?BW|EW|RX)\]|AND|OR|ANDNOT)';
122    
123  sub results_ajax : Path( 'results/ajax' ) {  sub results_ajax : Path( 'results/ajax' ) {
124          my ( $self, $c ) = @_;          my ( $self, $c ) = @_;
# Line 146  sub results_ajax : Path( 'results/ajax' Line 146  sub results_ajax : Path( 'results/ajax'
146                  my $v = $params->{$f} || next;                  my $v = $params->{$f} || next;
147    
148                  if (my $op = $params->{ '_' . $f}) {                  if (my $op = $params->{ '_' . $f}) {
149                          if ($v =~ $hest_op_regex) {                          if ($v =~ /$hest_op_regex/) {
150                                  # don't split words if there is Hyper Estraier                                  # don't split words if there is Hyper Estraier
151                                  # operator in them                                  # operator in them
152                                  push @words, $v;                                  push @words, $v;
# Line 164  sub results_ajax : Path( 'results/ajax' Line 164  sub results_ajax : Path( 'results/ajax'
164                  } else {                  } else {
165                          map {                          map {
166                                  push @attr, "$f ISTRINC $_";                                  push @attr, "$f ISTRINC $_";
167                          } grep { ! $hest_op_regex } split(/\s+/, $v);                          } grep { ! /$hest_op_regex/ } split(/\s+/, $v);
168                  }                  }
169          }          }
170    

Legend:
Removed from v.312  
changed lines
  Added in v.313

  ViewVC Help
Powered by ViewVC 1.1.26