Share this Page URL

Chapter 20. Web Page Doodads You Should ... > The Searchable Site: Adding a Search... - Pg. 229

Web Page Doodads You Should Know About 229 · The search engine--This is the part that does the actual searching of your site. There are many different types of search engine, but there are two main types for you to consider: search hosting and CGI scripts. I discuss these in detail a bit later. Webmaster Wisdom See Chapter 8, "Publish or Perish: Putting Your Page on the Web," for the details on setting up your site for search engines. · The search index--Before the search engine can run searches, it must first "crawl" through your site, reading the text of each page. As it goes along, it compiles a list of the words on each page (usually bypassing common words such as "the" and "and"). The words, along with pointers to the pages in which they appear, are stored in a file called an index . When the user searches for a particular word, the search engine looks up the word in the index, grabs a list of the pages in which that word appears, and then displays that list to the user. Page Pitfalls Depending on the size of your site, search indexes can get quite large, so be prepared for them to usurp a decent-sized chunk of whatever disk space your web host has set aside for you. · The search form--This is the form that your visitors use to enter their search criteria. Look for a search service that provides a prebuilt form (ideally, one that can be customized to blend in with your site design). Your search for a good search feature should begin at home. That is, you should first ask your web hosting provider if it offers a search feature for its customers. If not, then it's time to hit the road. As I mentioned earlier, there are two main types of search features to consider: a CGI script and a search host. The CGI route involves installing a script on your web host's server, either in your own CGI-BIN (if you have one) or the host's global CGI-BIN. Remember that most hosts will want to inspect a CGI script before they'll let you install it. To find a script, see my list of CGI resources in Chapter 12, "Need Feedback? Create a Form!" A search host is a separate site that hosts not only the search engine, but also the search index. This type of search is marginally slower because the data has to go to and from the other server. However, it's the only way to go if your web host won't allow you to install a CGI program or Java applet, or if your disk space on the server is running low. Here are some search hosts to check out: