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

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

revision 144 by dpavlin, Tue May 8 14:11:38 2007 UTC revision 151 by dpavlin, Sat Jun 9 10:27:03 2007 UTC
# Line 22  Grep::Search - full text search using L< Line 22  Grep::Search - full text search using L<
22    
23    my $search = Grep::Search->new();    my $search = Grep::Search->new();
24    
25    my $serach = Grep::Search->new( create => 1 );    my $search = Grep::Search->new( create => 1 );
26    
27    =head2 invindexer
28    
29    Accessor to call any method defined on L<KinoSearch::InvIndexer>
30    
31      $search->invindexer->delete_by_term( 'id', 42 );
32    
33  =cut  =cut
34    
# Line 115  sub add { Line 121  sub add {
121          $self->invindexer->add_doc( $doc );          $self->invindexer->add_doc( $doc );
122    
123          $self->log->debug("added ", $i->id, " for user $uid to index");          $self->log->debug("added ", $i->id, " for user $uid to index");
124    
125            return 1;
126  }  }
127    
128  =head2 collection  =head2 collection
# Line 140  sub collection { Line 148  sub collection {
148                  invindex => Grep::Search::Schema->open( $self->index_path ), );                  invindex => Grep::Search::Schema->open( $self->index_path ), );
149          $self->log->debug("$searcher created");          $self->log->debug("$searcher created");
150    
151          my $full_q = "($q) AND _owner_id:" . Jifty->web->current_user->id;          my $full_q = "($q)";
152    
153            my $uid = Jifty->web->current_user->id;
154            $full_q .= ' AND _owner_id:' . $uid if ($uid);
155    
156          $self->log->debug("searching for '$q' using $full_q");          $self->log->debug("searching for '$q' using $full_q");
157          my $hits = $searcher->search(          my $hits = $searcher->search(
# Line 199  sub finish { Line 210  sub finish {
210    
211          undef $self;          undef $self;
212    
213          return;          return 1;
214  }  }
215    
216  =head2 snippet  =head2 snippet

Legend:
Removed from v.144  
changed lines
  Added in v.151

  ViewVC Help
Powered by ViewVC 1.1.26