/[jquery]/no_pager/index.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 /no_pager/index.cgi

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

revision 5 by dpavlin, Tue Aug 15 16:56:49 2006 UTC revision 10 by dpavlin, Wed Aug 16 01:02:00 2006 UTC
# Line 34  my $node = new Search::Estraier::Node(%{ Line 34  my $node = new Search::Estraier::Node(%{
34    
35  my $o = $q->param('index') || 0;  my $o = $q->param('index') || 0;
36  my $search = $q->param('q');  my $search = $q->param('q');
37    $search = join(" AND ", split(/\s+/, $search)) unless ($search =~ m/(?:AND|OR|\[|\])/);
38    
39  my $on_page = 30;  my $on_page = 30;
40  my $skip = $o * $on_page;  my $skip = $o * $on_page;
# Line 43  $cond->set_phrase( $search ); Line 44  $cond->set_phrase( $search );
44  $cond->set_max( $on_page );  $cond->set_max( $on_page );
45  $cond->set_skip( $skip );  $cond->set_skip( $skip );
46    
47  my $nres = $node->search($cond, 0);  my $nres = $node->search($cond, ( $config->{estraier}->{depth} || 0 ) );
48    
49  my $max = 0;  my $max = 0;
50    
51  if (defined($nres)) {  if (defined($nres)) {
52          $max = $nres->hits;          $max = $nres->hits;
53          print "Got ", $nres->hits, " results for $search\n";          my $time = $nres->hint('TIME');
54            print qq{
55                    <div id="status_update" style="display:none;">
56                            Got <b>$max</b> results for <tt>$search</tt> in <em>$time s</em>
57                    </div>
58            };
59    
60          sub html_snippet {          sub html_snippet {
61                  my $text = shift || return;                  my $text = shift || return;
# Line 76  if (defined($nres)) { Line 82  if (defined($nres)) {
82    
83                  print "<h1>", $rdoc->attr('@title'),"</h1>\n";                  print "<h1>", $rdoc->attr('@title'),"</h1>\n";
84                  print "<h2>", $rdoc->attr('source'),"</h2>\n";                  print "<h2>", $rdoc->attr('source'),"</h2>\n";
85                  print "", html_snippet( $rdoc->snippet ),"<br/>\n";                  print "<h3>", $rdoc->attr('@mdate'),"</h3>\n";
86                    print "<p>", html_snippet( $rdoc->snippet ),"</p>\n";
87                  print "[", $skip + $i, "] ";                  print "[", $skip + $i, "] ";
88                  print "<tt>", $rdoc->attr('@uri'),"</tt>";                  print "<tt>", $rdoc->attr('@uri'),"</tt>";
89                  print "</li>";                  print "</li>";

Legend:
Removed from v.5  
changed lines
  Added in v.10

  ViewVC Help
Powered by ViewVC 1.1.26