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:
- Added web.config Events and SearchConfiguration areas
- 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.)
- Created dottext.search project in VS.NET from 0.96 source
- 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...)
- Stored procs: blog_insertLog, blog_log table, blog_SetLastExecuteScheduledEventDateTime, blog_GetLastExecuteScheduledEventDateTime, blog_aggregate_search_bu/_search
- Added BlogScheduledEventsException method to Framework.Exceptions.cs
- Added ScheduledItems array to Framework.Configuration.BlogConfigurationSettings.cs
- Added Framework.Util.Stopwatch class from 0.96
- Added Page.cs to dottextweb.UI.webcontrols
- Added BlogSearch.ascx/.cs to skins/ui areas in dottextweb
- Updated blog_aggregated_search procs to remove weblogs.asp.net. Changed the SqlDataProvider method to pass the AggregatedHost value.
- 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
- Added link to Rebuild Search Index in Admin.EditPosts.aspx.cs BindLocalUI()
- Created /searchindex folder on WebHost4Life site. Added RWXD perms to IUSR_.
- Customized blogsearch.ascx to duplicate dbvt.com./blog CSS style formating
- 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