Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Can search.cgi search any faster

Quote Reply
Can search.cgi search any faster
Hi there,

I have a links database with 1400 entries. One of my categories has 1100 entries and a search like 'Category' = SFAC results in the search term being too common. I removed the restriction on hits and now get the file contains no data. Does anybody know how to fix that problem?

Then I try search on a category containing 225 links and the search on a T-1 line takes 30 - 40 seconds. Is anybody else having this problem? Does anyone know how to speed up the search results, or have an idea where I can start looking. I've tried fiddling with the sorting routines and that has no effect on the speed. Any ideas?

Quote Reply
Re: Can search.cgi search any faster In reply to
How many total links do you have in your database?

One suggestion I have is to break up your links into more sub-categories.


Eliot Lee
Anthro TECH,L.L.C

Quote Reply
Re: Can search.cgi search any faster In reply to
if you use the GREP search.cgi.. it will go faster.. it only works on Unix i think.. i got 7000 links to search in 1 second average..

it's located somewhere in this forum..

it's accurate (yea..).. what it does is open the whole db and save it in an array.. then grep does it's thing which only takes 0-2 seconds by stripping out all the unneeded links.. then it does the regular thing by checking the fields you need to see if they match the search..

keep in mind if your site is about free stuff and everyone put the words "free" in their descriptions.. the speed will be just about the same.. so it's best on a "diverse" site


[This message has been edited by widgetz (edited November 29, 1999).]
Quote Reply
Re: Can search.cgi search any faster In reply to
Thanks Widgetz and Elliot,

I was able to find the grep code from the forum at http://www.gossamer-threads.com/scripts/forum/resources/Forum11/HTML/001297.html .

That helped a bunch, however, suddenly I'm unable to use field=whatever as in ID=259 . In this case, the script thinks the &{$regexp} is calling for a subroutine.

I'm still having this problem with lengthy time. While grep has speeded up thing up by a couple of seconds, 255 results still takes 30 seconds or so and 1100 results took more than 5 minutes. Now, I saw in this forum:

that the build html eats the improvements attained through grep and that this might be improved. Has anyone figured out anything on this.

Elliot, my database is 1400 entries big, with 33 fields.

Finally, I saw mention in another forum
that the grep code didn't work with and/or.

I do find that the AND works with 2 or fewer keywords in separate fields and it works with 3 or more keywords as long as the words are all found in the same field. The OR seems to work just fine.