Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Added Lucene Searching to my .Text 0.95 blog

There are a number of interesting implementations of .text searching out there with FindFree or Google or something else, but I wanted to continue to follow ScottW's coding path as closely as possible, so there was no other choice but to extract the Lucene pieces from 0.96 (in progress) and bring them into my 0.95 source.  I decided during last night's geek time that I was going to make this happen, and with a normal workday in between latenight geek sessions, my Lucene search page is online. There were a number of steps to make it happen, but Scott's source was, as always, extremely logical and easy to walk through to pull what I needed and make the necessary updates. That guy is scary good!

I have a few kinks to work out.  I need to work through the details of getting the Event Schedule-based Search Index to execute.  As a work-around to scheduled indexing I added a Build Search Index function in the Admin area.  The search term highlighting doesn't work in the search results yet either, but that will come.  All in all, I am extremely tickled with the results so far. 

I jotted down notes to track the implementation which I promise to expand in a future post, but for now the steps I followed were:

  1. Added web.config Events and SearchConfiguration areas
  2. Added search.aspx in root and /aggsite/search.ascx control.  (Later deleted search.aspx since it was handled through .text HttpHandler addition in web.config.  Also eventually removed search.ascx control and rewrote /skins/blogsearch.ascx to handle the searching.)
  3. Created dottext.search project in VS.NET from 0.96 source
  4. Added new logging and eventscheduling methods in data layer.  (An additional benefit of pulling pertinent code from Scott's 0.96 source is that logging is now supported as well as eventscheduling--once I get the eventscheduling piece figured out...)
  5. Stored procs: blog_insertLog, blog_log table, blog_SetLastExecuteScheduledEventDateTime, blog_GetLastExecuteScheduledEventDateTime, blog_aggregate_search_bu/_search
  6. Added BlogScheduledEventsException method to Framework.Exceptions.cs
  7. Added ScheduledItems array to Framework.Configuration.BlogConfigurationSettings.cs
  8. Added Framework.Util.Stopwatch class from 0.96
  9. Added Page.cs to dottextweb.UI.webcontrols
  10. Added BlogSearch.ascx/.cs to skins/ui areas in dottextweb
  11. Updated blog_aggregated_search procs to remove weblogs.asp.net.  Changed the SqlDataProvider method to pass the AggregatedHost value.
  12. Uncommmented index generation code from Queue.aspx.  Mutex error on RebuildSafeIndex().  Used RebuildIndex without error.  Used queue.aspx.cs code as basis for manual Rebuild Search Index Admin function
  13. Added link to Rebuild Search Index in Admin.EditPosts.aspx.cs BindLocalUI()
  14. Created /searchindex folder on WebHost4Life site.  Added RWXD perms to IUSR_.
  15. Customized blogsearch.ascx to duplicate dbvt.com./blog CSS style formating
  16. Comments were being searched (which is cool), but noticed a bug (or inconsistency between 0.95/0.96) resulting in comments to comments making the comment the parentID rather than the original post.  As a quick fix, I removed comments from the search index by changing the blog_aggregate_search proc from c.PostType & 3 > 0 to c.PostType = 1

 

Comments (2) | Post RSS RSS comment feed

Posted on 1/24/2005 8:44:00 PM by Dave Burke
Categories:
Tags:

Related posts

Comments (2) -

2/2/2005 10:12:00 PM Permalink

Dave, thanks for this post! By following the steps you listed here I was able to get search working for my company's internal blog site.  It works great!

Mark Olson |

2/2/2005 10:14:00 PM Permalink

Mark,  That is so great!  Don't forget the two follow-up posts on it to tie up lose ends.  Thanks for sharing!

Dave Burke |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke