hey everyone. i'm a newbie here. anyway, i'm using a search engine software called 'links 2.0', based on the perl language, installed on a unix system. my site hasn't opened up yet, though i'm pretty much done with hacking and modifying. i'm in the process of adding links to the database. however, as the database builds up, the search gets much slower, sluggish to be blunt. i heard that using mysql is faster, although i don't have the money for that.

so basically my question is, how do i make my search engine perform better, faster and more efficiently? i've been searching through the forums related to this software and have been reading about perl core dumps and the grep function, but no definite codes have been thought up to make it work.

my search.cgi is a 21 kb file that goes through a 70kb database with around 200 links, each with an ID, Title, Category, Description, and Keywords.

here are some codes to guide you:

# Go through the database. open (DB, "<$db_file_name") or &cgierr("error in search. unable to + open database: $db_file_name. Reason: $!"); flock (DB, 1) if ($db_use_flock); LINE: while (<DB>) { /^#/ and next LINE; # Skip comment Lines. /^\s*$/ and next LINE; # Skip blank lines. chomp; # Remove trailing new line. @values = &split_decode($_); $grand_total++;


i wonder if i could somehow modify the code above to the make the search faster. if you want the whole search.cgi file, you can view it at http://www.textcentral.com/search.txt. any kind of answer is highly appreciated. thanks perl gurus...

In reply to Faster Search Engine by drewboy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.