Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Fully Customisable CGI/Perl Search Engine?

Fully Customisable CGI/Perl Search Engine?
Thread Tools
megasad
Grizzled Veteran
Join Date: Oct 2002
Status: Offline
Reply With Quote
Mar 19, 2005, 02:20 PM
 
I want to put a search engine on my website as it needs one badly. I have a heavily modified Perl guestbook, that lives in my cgi-bin folder at present and it works good for me, so I kind of know what I'm doing.

There is only one folder I want to search the contents of. I also want to be able to have full control over what the results pages look like, and also to be able to have it ignore the "CBL - " text that is at the beginning of every pages title. I do not want it to create an index file, nor do I want it to require lots of files to be uploaded; one CGI script would be perfect.

I have tried using Google, various CGI script pages, but everything I've come across is either too simple or too complex.

Does anyone know of a script that would do what I want it to do? If you do, please tell me.
BayBook (13" MacBook Pro, 2.4GHz Core 2 Duo, 4GB RAM, 1TB HD) // BayPhone (iPhone 4, 32GB, black)
     
Finrock
Forum Regular
Join Date: Nov 1999
Location: Tampa, Florida
Status: Offline
Reply With Quote
Apr 15, 2005, 11:20 AM
 
It would be pretty easy, from a perl standpoint. You could read the directory and only put the files you want into the array. From there, you could have the script read each file in the array and search its text for the term. It wouldn't be the most efficient, but since you're limited to text files and not a database, it would work fine.

-Finrock
Two atoms were talking one day. One atom said to the other "you know, I think I've lost some electrons." The other atom said "are you sure?" The atom said "yeah, I'm positive." www.thisoldpodcast.com
     
megasad  (op)
Grizzled Veteran
Join Date: Oct 2002
Status: Offline
Reply With Quote
Apr 16, 2005, 09:32 PM
 
Originally Posted by Finrock
It would be pretty easy, from a perl standpoint. You could read the directory and only put the files you want into the array. From there, you could have the script read each file in the array and search its text for the term. It wouldn't be the most efficient, but since you're limited to text files and not a database, it would work fine.
Hot diggety! So, now I know that it can be done, does anyone know of someone who has made such a thing? Because I haven't the faintest clue even as where to begin, not knowing anything more complex than XHTML and CSS. Or would someone be willing to write it, that many people might use it?
BayBook (13" MacBook Pro, 2.4GHz Core 2 Duo, 4GB RAM, 1TB HD) // BayPhone (iPhone 4, 32GB, black)
     
Finrock
Forum Regular
Join Date: Nov 1999
Location: Tampa, Florida
Status: Offline
Reply With Quote
Apr 16, 2005, 11:17 PM
 
I suppose I could be coerced into writing something like that. I've been meaning to get around to writing one for my site, but I've been distracted lately. If you'd like to discuss feel free to e-mail me at finney at mac dot com.

-Finrock
Two atoms were talking one day. One atom said to the other "you know, I think I've lost some electrons." The other atom said "are you sure?" The atom said "yeah, I'm positive." www.thisoldpodcast.com
     
Finrock
Forum Regular
Join Date: Nov 1999
Location: Tampa, Florida
Status: Offline
Reply With Quote
Apr 20, 2005, 08:02 AM
 
I should have a preliminary version this weekend. E-mail me if you are still interested. I'll make it available for all to download for free.

-Finrock
Two atoms were talking one day. One atom said to the other "you know, I think I've lost some electrons." The other atom said "are you sure?" The atom said "yeah, I'm positive." www.thisoldpodcast.com
     
megasad  (op)
Grizzled Veteran
Join Date: Oct 2002
Status: Offline
Reply With Quote
May 7, 2005, 09:59 PM
 
Originally Posted by megasad
I have tried using Google, various CGI script pages, but everything I've come across is either too simple or too complex.
Right, so I finally got off my arse, bothered to fiddle about with the Perl script in the link, and I've got it working on my website to within an inch of how I want it to work.

See for yourselves

The only thing I have left to work out is how to have the results sorted alphabetically, rather than by "ranking". This script seems to be quite complex in how it determines a page's worth, but I do not need any of that, and I cannot work out how to make it simply list the results A to Z.

Does anyone know if this is impossible to do in Perl, and that's why no search engine I've been able to find will do it? Or can it be done?
( Last edited by megasad; Jun 27, 2005 at 07:41 PM. Reason: URL Update)
BayBook (13" MacBook Pro, 2.4GHz Core 2 Duo, 4GB RAM, 1TB HD) // BayPhone (iPhone 4, 32GB, black)
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:54 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,