• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

How to build a simple search engine?

wizzz

Senior member
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?
 
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.
 
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?
>>

 
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.
 
"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.
 
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
 
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".
 
Back
Top