Forum Moderators: open

Message Too Old, No Replies

How do I create an in site search engine?

         

Paper_ChasA

11:47 am on Jan 8, 2006 (gmt 0)



I already have a search box that can go on my site with the html:

<form id="search" action="">
<input name="searchFor" type="text" size="10">
<a href="#">search</a>
</form>

and I also have a page where I want it to search in: /photo_galleries.html

Do I have to set something special up to get this to work?

jecasc

7:47 pm on Jan 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Let me answer your question with an analogy. You go to your car mechanic and tell him:

"I want a four wheel drive into my car. Here I have a little button which says 4WD which would fit right here next to the knob for the air condition. Do I need something else to get this to work?"

Thats about the stage where you are right now. Unfortunately there is a little more to site search than a search box. There are tons of free scripts out there you can go with. Some database driven some not.

However if you lack the technical background I would recommend to implement a google search box which you can customize for site search:

[google.com...]

innocbystr

10:00 am on Jan 9, 2006 (gmt 0)

10+ Year Member



Best I recollect you have to be in the Google directory for the Google Search box to search your site. Yahoo's works wether you're in their directory or not:

[search.yahoo.com...]

Mistra

3:09 pm on Jan 9, 2006 (gmt 0)

10+ Year Member



There are 3 ways to solve your problem:

(1) Easiest solution is adding the Yahoo search box like the one recommended if your site is already indexed by Yahoo! But if it is not indexed then you are not able to search it.
(2) If your site is a dynamic site that is database driven site then you have to search your database. This involve some programming where you have to write some codes and SQL query statement to search your database.
(3) In your case, I assume that your site is a static site that is all your files are html files. There is something missing in your search form there:


<form id="search" action="">
<input name="searchFor" type="text" size="10">
<a href="#">search</a>
</form>

Your "action" is blank. So when you pressed the search button no action would be taken. You need to write some codes in order to make your search form works. Do you know any web programming language like Perl, php, Asp, Java?

I assume that you know. Let's say you wrote your search code in Perl language and call it search.pl. You will have to upload this code into cgi-bin folder in your Linux web server. Then you will have to put the URL of this search code into your search form that is something like this:


<form id="search" action="http://yourwebsite/cgi-bin/search.pl">
<input name="searchFor" type="text" size="10">
<a href="#">search</a>
</form>

so that whenever you press the submit button, your search.pl will be executed to search your site.

If you do not have the capability to write your own search code then I suggest you try "Perlfect Search" script. You have to know a little bit about how CGI works in order to use the script.

Good luck with your site!

MatthewHSE

9:54 pm on Jan 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Perlfect was going to be my recommendation too. It has good relevancy and is very fast and customizable.

You have to know a little bit about how CGI works in order to use the script.

A very little bit, actually. If you can follow basic instructions, know how to use FTP, and can edit a few files, you'll have it working in no time. Note that you'll also want to have SSH access to your site to run the indexer, or else run it by cron every so often. (You can run the indexer through the browser, but that's much less secure...)

jecasc

8:49 pm on Jan 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You do not need to be in the Google Directory for Site search however like with Yahoo the site has to be already in the search engine index.

Dijkgraaf

6:54 pm on Jan 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use [freefind.com...] to index my site and they also give you the html code for the search box.
The advantage of this is that you can control how often it indexes your site.

topr8

6:58 pm on Jan 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



imho don't bother unless you have a big gallery with lots of pictures/info, otherwise you are going to get lots of empty results - of course you can serve a standard page when there are no matches but ... they still don't find what they look for.

tangor

5:36 am on Jan 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've been using atomz for about 3 years and been very happy, though the free verison was limited to 500 pages. However, it appears they have been bought out by websidestory.