Last updated:

DesignNewz
FlashNewz
DevWebPro




Visit the WebDeveloperNewz Directory
Adobe Dreamweaver Links
Adobe.com Dreamweaver Info
Blogs
Blogger, Blogosphere, Web 2.0...
Design Agencies
Adobe Dreamweaver Links
Education And Training
Communicate, Help, Advertise...
Flash Tutorials
Artists, Designers, Experts...
Forums
Search, Learn, Communicate...
Javascript Tutorials
Books, Help, Learning...
News
Technology, Business, Web...

Adding Search Capabilities To A Blog Engine

By Mads Kristensen
Expert Author
Article Date: 2007-03-30

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"

  ButtonText="Search"

  CommentLabeltText="Search in comments"

  EnableCommentSearch="true"

  DefaultText="Enter search term" />


OpenSearch

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

About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/

Newsletter Archive | Article Archive | Submit Article | Advertising Information | About Us | Contact

WebDeveloperNews is an iEntry.com publication
© 1998-2008 iEntry Inc. All Rights Reserved Privacy Policy Legal

Click Here to Return to the Home Page