The in-site search feature has been under development for a few days by Claus Christensen. Claus has been developing his own search engine for the last couple of years, so he knows a lot about search algorithms and performance.

The algorithm ranks the different hits based on an advanced formula so that the closes hits are always displayed at the top. I think it’s safe to say that the in-site search will be one of the best on any blog engine today.

Search comments

Often on blogs, the comments can be just as informative as the post itself, so we wanted to make the comments searchable.

When you hit the search button, an onclick JavaScript handler is called. The handler redirects the client to root/?q=searchterm and if comment search is checked it redirect to root/?q=searchterm&comment=true.

Customize search field

The search field is totally customizable so you can change everything about it by setting properties in the markup.

<blog:SearchBox runat="server"


  CommentLabeltText="Search in comments"


  DefaultText="Enter search term" />


We also added support for OpenSearch so that IE, Firefox and other browsers can use the built in search capability to search the blog.

OpenSearch support is added for both HTML and RSS.

Related posts

The search algorithm can also be used to display a short list of related posts. It would be a great help to the visitors to show them links to other posts on your blog that is similar to the one the visitor is reading. It is important to show only the posts that bare a real resemblance and not just the 5 most similar ones or 5 randomly chosen from the same category. It could be that there is no other post on the blog that is similar. In that case, no links are shown.

Search on search

Whenever a visitor arrives from a search engine, we can read the search term from the referrer URL. That information can be used to do a short search on the blog to display to the user at the top 200 pixels of the page. That way we can present the visitor to a more detailed search result – a result that’s probably more accurate because it isn’t filtered using PageRank.


Comments are closed