How to build a simple search engine?

wizzz

Senior member
Jul 20, 2000
267
0
0
Hello.
I'm looking to put a search engine that only searches within its own site.
And javascript must be used for the search engine. Nothing else.

So can anyone tell me how I can build one?
 

Turkey

Senior member
Jan 10, 2000
839
0
0
I think that is impossible... javascript can't access anything on other pages, only its own. In almost all search engines (could even be all of them) there is a "spider" that examines all the pages. Some of them enter data into a database and the database is queried when a person searches, and some of them search only when a search is done and they just return data directly. But you gotta be able to examine all the pages in the site. If you could maybe do it with applets, but they might have the same problem. You could do it with ASP/PHP/JSP or some other server-side scripting language.
 

Locutus4657

Senior member
Oct 9, 2001
209
0
0
I think this is impossible, not for the reason stated before about spiders... After all you don't need a spider searching your own site. It is impossible because you will need to access some form of database which will store the information about your site... The problem is so far as I know Javascript does not support JDBC (Java's database connection interface). It should be possible for you to get the job done with a combination of Javascript/java/rmi.

Carlo



<< Hello.
I'm looking to put a search engine that only searches within its own site.
And javascript must be used for the search engine. Nothing else.

So can anyone tell me how I can build one?
>>

 

blahblah99

Platinum Member
Oct 10, 2000
2,689
0
0
one way is to use a database like turkey said... write an external program using your favorite language that will extract all the non-common words off a web file and put it in database format so it can be entered into a database.
 

NogginBoink

Diamond Member
Feb 17, 2002
5,322
0
0
"Simple" and "search engine" do not belong in the same sentence.

Save yourself the headaches, and get a shrinkwrapped solution. There are cheap/free search engines for most web servers.
 

tweakmm

Lifer
May 28, 2001
18,436
4
0
well, despite what these people are saying, having a search engine for your entire site would be possible although ALOT more trouble than its worth. You could somehow store an aray in the search webpage(the actual page) and then have javascript search the array. Although, this would be a pain to update, make everything run very slow and be a general pain
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
IIRC, you can have google index your whole site and use google with a "site:www.blah.com" added to your query. that would be easy, even if it doesn't look "fancy".