Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > looking for simple code to build a search engine

Reply
Thread Tools

looking for simple code to build a search engine

 
 
Marcel
Guest
Posts: n/a
 
      11-30-2004
Hi,
I have a hobby website with many, many pages with pictures on which I want
to install a search engine. The ones I've had a look at don't exactly do
what I want. So I want to make it myself. On the other hand, I'm completely
new to Perl - it does work fine on my computer though.
My idea is as follows:
any search on my website looks into a file (search.txt) of which each line
looks something like "url= .... thumb= ... title= .... keywords= ...".
The keywords-part (of course) must be scanned, and if a match is found, then
the title, url and thumbnail must be returned to the search page.
The search.txt is fed by my pictures database.
Is there something out there that I can use?
Many thanks,
Marcel


 
Reply With Quote
 
 
 
 
Alan Mead
Guest
Posts: n/a
 
      11-30-2004
On Tue, 30 Nov 2004 09:47:37 +0000, Marcel wrote:

> looks something like "url= .... thumb= ... title= .... keywords= ...".
> The keywords-part (of course) must be scanned, and if a match is found,
> then the title, url and thumbnail must be returned to the search page.


You'll get your hand slapped if you ask CGI question here that really have
nothing to do with Perl. Try comp.infosystems.www.authoring.cgi for those
sorts of questions but feel free to ask about PERL stuff here.

But here is some Perl advice: You'll be re-inventing a fair bit of
wheel... not that you would be the first Perl hacker to do so....

But I wouldn't re-invent the database part. Look into dbm or an SQL
database. dbm is simpler. It's like a hash on disk. I would use two dbm
files. First, store your url+thumb+title in one with some sort of unique
key (it could be a sequential number). Then store each keyword with the
unique key in a second dbm file. You would have to code the search to
open the second file, find the unique keys of the matching keywords and
then open the first file to retrieve those records by the unique keys.

But this is clearly a tuple relationship where the unique key to your
pictures is the foreign key to the second table (or.. I reversed them).
I'm sure you would be better off using a good SQL engine which adds the
possibility of doing 'LIKE %keyword%' searches. Of course, you need to
learn some SQL. There are lots of good RDBMS for those level of use...
MySQL is very popular. You could also use SQLite or something similar if
you don't want to get into (or cannot) install something weighty.

Don't store your thumbnails in the database, just store the path to the
file.

-Alan
 
Reply With Quote
 
 
 
 
James Willmore
Guest
Posts: n/a
 
      11-30-2004
On Tue, 30 Nov 2004 09:47:37 +0000, Marcel wrote:

> I have a hobby website with many, many pages with pictures on which I
> want to install a search engine. The ones I've had a look at don't
> exactly do what I want. So I want to make it myself. On the other hand,
> I'm completely new to Perl - it does work fine on my computer though. My
> idea is as follows:
> any search on my website looks into a file (search.txt) of which each
> line looks something like "url= .... thumb= ... title= .... keywords=
> ...". The keywords-part (of course) must be scanned, and if a match is
> found, then the title, url and thumbnail must be returned to the search
> page. The search.txt is fed by my pictures database. Is there something
> out there that I can use?


Try searching Freshmeat (http://freshmeat.net/). There are scripts there
that will do exactly (or, at least, similar) to what you want to do.

Or, use Google

HTH

Jim
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      11-30-2004
Alan Mead <(E-Mail Removed)> wrote:

> feel free to ask about PERL stuff here.



That would be "Perl stuff", not "PERL stuff".

The name of the language is not an acronym (the Perl FAQ says so).


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
Alan Mead
Guest
Posts: n/a
 
      11-30-2004
On Tue, 30 Nov 2004 12:03:21 -0600, Tad McClellan wrote:

> Alan Mead <(E-Mail Removed)> wrote:
>
>> feel free to ask about PERL stuff here.

>
> That would be "Perl stuff", not "PERL stuff".
>
> The name of the language is not an acronym (the Perl FAQ says so).


That would be SHOUTING

-Alan
 
Reply With Quote
 
Gregory Toomey
Guest
Posts: n/a
 
      12-01-2004
Marcel wrote:

> Hi,
> I have a hobby website with many, many pages with pictures on which I want
> to install a search engine. The ones I've had a look at don't exactly do
> what I want. So I want to make it myself. On the other hand, I'm
> completely new to Perl - it does work fine on my computer though.
> My idea is as follows:
> any search on my website looks into a file (search.txt) of which each line
> looks something like "url= .... thumb= ... title= .... keywords= ...".
> The keywords-part (of course) must be scanned, and if a match is found,
> then the title, url and thumbnail must be returned to the search page.
> The search.txt is fed by my pictures database.
> Is there something out there that I can use?
> Many thanks,
> Marcel



For Perl search engines for a single website look at

http://www.htdig.org/ (I use this myself)
http://swish-e.org/
http://www.xav.com/scripts/search/ (used this in the past)

gtoomey
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting 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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.Net Search Engine - Has anyone used dtSearch .Net Engine? Sasha ASP .Net 3 05-22-2007 04:20 PM
Gain the TOP Search Engine Placement You Need to Build Your Business Exponentially. wlxonline@yahoo.com Computer Support 0 09-20-2005 12:18 AM
SWsoft Acronis Disk Director Suite 9.0 Build 508, Acronis OS Selector 8.0 Build 917, Acronis Partition Expert 2003 Build 292, Acronis Power Utilities 2004 Build 502, F-SECURE.ANTI vIRUS.PROXY v1.10.17.WINALL, F-SECURE.ANTI vIRUS v5.50.10260 for CITRI vvcd Computer Support 0 09-25-2004 01:38 AM
search within a search within a search - looking for better way...my script times out Abby Lee ASP General 5 08-02-2004 04:01 PM



Advertisments