Skip to main content.
home | support | download

Back to List Archive

Re: [SWISH-E:134] Re: swish-e CGI

From: Omar Thameen <omar(at)not-real.clifford.inch.com>
Date: Fri Jan 30 1998 - 07:19:29 GMT
On Thu, Jan 29, 1998 at 09:06:27AM -0800, Eli's List Clearing House wrote:
> Omar Thameen <omar@clifford.inch.com> wrote:
[...]
> > So while I'm writing, here are my suggestions for future versions of
> > swish-e.
> > 1. When "a word is too common", report the word that is too common.
> > 2. When searching multiple indexes, don't stop processing if one of 
> >    the files doesn't exist, move on to the next one and print the
> >    errors at the end.
>   3. When searching multiple index files, don't sort the ranks of return
>      results individually. (At least I think that is what is happening.)

I got around #3 by adding a line to sub search_parse (hopefully
I'm quoting enough before and after to make it clear):

------------------------- Begin included text -------------------------
...
<TR><TH>Ranking<BR>(1000 max)</TH><TH>Subject</TH><TH>Filesize<BR>(bytes)</TH></
TR>
Search_Results

  # this sorts by numeric order in case you're searching through
  # multiple files (p. 171, Learning Perl)
  @results = reverse ( sort {$a <=> $b} @results );

  foreach (@results) {
     select(STDOUT);
     ($stringone, $title, $filesize) = split(/\"/, $_);
     ($rank, $url) = split(/ /, $stringone);
     print <<EOF;
...
-------------------------- End included text --------------------------

Omar
Received on Thu Jan 29 23:29:58 1998