Ruwan's Blog

Thursday, April 22, 2010

SharePoint Search Customization

A client of mine has an internet facing SharePoint (MOSS 2007) Collaboration site. This site has several pages that use a set of Search Core Result web parts to display documents that have been tagged with specific meta data. Now you are probably thinking this is nothing unusual at all and isn't this how SharePoint is supposed to be used.


One of the requests we got from the client was to create a copy of the production MOSS instance that could be used as a Test Environment. We also knew that a lot of the URLs in the master pages (yep there is more than one master page for this application) and throughout some of the pages were "hard-coded" to the absolute URL of the production environment.

Some of the pages that had the Core Results web part were customized to bring back more columns than are returned by default (I.e. a categorization of documents etc). Some of these columns hadn't been brought over when we migrated the database from production to the test environment. One of the columns that was specified was the "Write" Column. However, I couldn't find a managed property with that name on either the production instance or the new Test instance. So, I (incorrectly, I later found out) created a new managed property called "write" on the Test instance. I then did a complete re-crawl of the content source and did a search. This brought back data, when the search was based on relevance. However, when I did a search by "Modified Date" I got no results back. I went as far as looking at the XML results that are returned from MOSS search and then later displayed using XSLT and found that there were no nodes being returned within the all results node.

However, when I removed the 'write' managed property the web parts started bringing back results by relevance and by modified date.

My conclusion was that there is an implicit managed property called 'write' that is crawled by the MOSS crawler and added to the index. This managed property stores the last modified date of a document or list item etc. This is returned in the results of a search query and is used to order the results when a sort by modified date is performed. When I manually created a managed property called write, this overrode the value that was returned by the search service thus returning a blank value and breaking the view by last modified date.

Labels: , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home