/[Grep]/lib/Grep/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 /lib/Grep/Search.pm

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

revision 190 by dpavlin, Fri May 23 21:05:42 2008 UTC revision 198 by dpavlin, Sun Oct 12 11:48:45 2008 UTC
# Line 101  sub add { Line 101  sub add {
101          $uid ||= Jifty->web->current_user->id;          $uid ||= Jifty->web->current_user->id;
102          $doc->{ '_owner_id' } = $uid;          $doc->{ '_owner_id' } = $uid;
103    
104          $self->SUPER::add( $doc );          eval { $self->SUPER::add( $doc ); };
105            $self->log->error( $@ ) if $@;
106    
107    
108          $self->log->debug("added ", $i->id, " for user $uid to index");          $self->log->debug("added ", $i->id, " for user $uid to index");
# Line 128  sub collection { Line 129  sub collection {
129    
130          my $q = shift or die "no q?";          my $q = shift or die "no q?";
131    
132          my $full_q = "($q)";          my $next_hit = $self->search( $q );
   
         my $uid = Jifty->web->current_user->id;  
         $full_q .= ' AND _owner_id:' . $uid if (defined $uid);  
   
         $self->log->debug("searching for '$q' using $full_q");  
   
         my $next_hit = $self->search( $full_q );  
133    
134          $self->log->debug("found ", $self->hits, " results");          $self->log->debug("found ", $self->hits, " results");
135    
# Line 189  sub snippet { Line 183  sub snippet {
183          }          }
184  }  }
185    
186    =head2 finish
187    
188      $search->finish;
189    
190    =cut
191    
192    sub finish {
193            my $self = shift;
194            eval { $self->SUPER::finish( @_ ) };
195    }
196    
197  1;  1;

Legend:
Removed from v.190  
changed lines
  Added in v.198

  ViewVC Help
Powered by ViewVC 1.1.26