/[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 152 by dpavlin, Sat Jun 9 10:27:03 2007 UTC revision 153 by dpavlin, Sun Jun 10 11:52:24 2007 UTC
# Line 151  sub collection { Line 151  sub collection {
151          my $full_q = "($q)";          my $full_q = "($q)";
152    
153          my $uid = Jifty->web->current_user->id;          my $uid = Jifty->web->current_user->id;
154          $full_q .= ' AND _owner_id:' . $uid if ($uid);          $full_q .= ' AND _owner_id:' . $uid if (defined $uid);
155    
156          $self->log->debug("searching for '$q' using $full_q");          $self->log->debug("searching for '$q' using $full_q");
157    
158            my $query_parser = KinoSearch::QueryParser->new(
159                    schema => Grep::Search::Schema->new,
160                    fields => [ qw/ title link content summary category author / ],
161            );
162            $query_parser->set_heed_colons(1);       # enable field:value AND/OR/NOT syntax
163            my $query = $query_parser->parse( $full_q );
164          my $hits = $searcher->search(          my $hits = $searcher->search(
165                  query           => $full_q,                  query           => $query,
166  #               offset          => $offset,  #               offset          => $offset,
167  #               num_wanted      => $hits_per_page,  #               num_wanted      => $hits_per_page,
168          );          );
# Line 237  sub snippet { Line 244  sub snippet {
244  package Grep::Search::KeywordField;  package Grep::Search::KeywordField;
245  use base qw( KinoSearch::Schema::FieldSpec );  use base qw( KinoSearch::Schema::FieldSpec );
246  sub analyzed { 0 }  sub analyzed { 0 }
247    #sub indexed { 1 }
248    #sub stored { 1 }
249    sub vectorized { 0 }
250    
251  package Grep::Search::Schema;  package Grep::Search::Schema;
252    

Legend:
Removed from v.152  
changed lines
  Added in v.153

  ViewVC Help
Powered by ViewVC 1.1.26