Supa Dupa Search »
FERDY CHRISTANT - OCT 9, 2004 (02:32:50 PM)
As of now, this site has a search, a new important feature of blog.s3maphor3.
Functionally, the search is as simple as can be. It returns a list of links, with a maximum of a 100, of the most relevant matches. You can also see whether the search result is a blog, article, page or comment. Simple, but it works.
Technically, it's quite a challenge to implement a XHTML-compliant search. You cannot use searchtemplates in HTML mode, Domino does not allow it, end of discussion. I was afraid to have to use an agent that would spit out the full XHTML markup. That would suck, since it would mean I would have to repeat my carefully crafted layout structure in more than one place. That would be against the DRY principle (Don't Repeat Yourself), and I wouldn't wanna piss of the Pragmatic Programmers would I?
In a nutshell, here's the solution:
- Every page has a search subform embedded. The search subform is a small block of HTML that defines the in-line search form. This custom form has its action attribute pointed to the creation URL of a special form.
- The special form has SaveOptions set to 0 to block saves. The $$Return field simply redirects the entered search query to the search result form, passing the query along with the URL.
Existing s3 bloggers: The search is implemented as an optional navigation block, you can choose to enable or disable it in the setup screen.
We're close to 1.00....stay tuned. Oh, and do stress-test my search, I'm curious if you can break it. Happy weekend!