Been a while since my last post. Mostly because we have been working very hard to complete a custom search solution.
The requirements for the solutions were:
- Data from Treeview controls that is entered into items must be able to be search using the Treeview control to select the search terms.
- Where there are Choice fields in the item columns these must be rendered as multiple select choices in the search UI.
- Values must be searchable based on a fixed set of ranges, eg. 1 million to 5 million.
- Date columns must be searchable based on a from date/to date range.
- Wildcards using * should be possible but no assumed.
- People fields should be searchable based on part of the name.
- Export results to Word and Excel documents.
Here's a sample of the sort of thing we came up with:

Along the way we discovered some things about MOSS searching:
- You cannot use the OOB web part to render your results unless you pass the query as a keyword query in the URL to a results page.
- You cannot search ranges using the Keyword Syntax.
- You cannot use FreeText or Contains to search People fields. LIKE works fine.
- Using FreeText and Contains makes handling wildcards and phrases very easy when building your SQL query string.
- You can stop Lists appearing in results by adding a search scope rule to exclude items where contentclass = STS_List_GenericList.
- The ListID for the item does not get returned in the search results. So we created an event receiver to add this to a hidden column so we could use it to build a custom export URL. If you know of a better/easier way, let me know!
- The StartRow for the SQL Query object is zero based, not 1 as I found much to my embarassment when no results came back from my single item list!
- The sample XSL in the SDK for rendering results is a better place to start than the XSL in the core results web part, just because it's less complex.
- Make sure you select the data type for a Managed Property Mapping before trying to find the property to map, as the list is filtered for you on data type - bit embarassing there too, esp the second time round!
- You can re-use the date picker control that is used in MOSS. Although we did have some problem with the rendering of the DatePicker CSS on our production server...
The best part of the solution is that it's all based on supported technologies (and no CAML in sight!) - Web Parts, Custom Field Controls, Custom ASP.Net Web Controls, XSL for rendering, Custom Search Scopes and Custom Search Tabs and Pages. Nice!