Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

searching in a web site

I think I'm one of the target market for City Desk -- not a knowledgeable  HTML coder -- so bear with me if this is simple. I'm struggling, but I'm making progress getting my head around CD.

On the side bar for my site, I would like to put a search capability that searches all the words in the web site and returns a list like the Search entry for this page does, but I can't figure out how to do it. I copy/pasted the button and that works, but then what? Where is the search engine code? Where/how do I link to the page that it places all the links in?

Also, to help sort through the hit list, I would like the list to include the links to each article as it does now plus the line that includes the search term.

Any suggestions?

Dick Dillon
Wednesday, December 12, 2001

So basically the key to your question is "where is the search engine code". Likely the answer for you right onw is "you don't have any".

What you need to do is find and install a search engine on your web server. Many have them built in (don't ask me which!) and simply need to be told which files are OK to search and which are verboten.

To wire it up you basically put a FORM tag around the field where you type in the search words (and the button) and simply send a URL to the engine. For instance...

http://www.gamesoffame.com/cgi/search?star trek

The engine receives this message, runs a search, and constructs a web page with all of the results on it. HTTP takes care of the rest - you sent a page request (the URL) so the browser is waiting to put the reply up as a page.

You will have to style the results using a template in a similar fashion as CD. The search engine docs will explain how.

Now one interesting feature for CD would be a feature to publish templates out to "other people" like this search engines. That way you could maintain everything inside CD.

Maury Markowitz
Wednesday, December 12, 2001

There are lots of free search engines atomz.com, google.com, freefind.com.

Basically, you go to the site, register, and tell them your URL.  You'll get a password and some HTML to paste into your website.  The service will "crawl" you site and maintain the search index on its server.  You can control how often the service re-indexes your site.

The HTML the send you is a search form: A box and a search button.  When you search, the form send the command to the search service's index and returns found pages.

You can set one of these up in about 5 minutes and it's easy.

Terry Kearns
Wednesday, December 12, 2001

Here's an article that compares the free search engines:

http://www.webreview.com/2001/10_22/authors/index01.shtml

Meryl
Sunday, December 16, 2001

*  Recent Topics

*  Fog Creek Home