Today, I am going through a second revision of the chapter on MOSS 2007 search. I was under the impression that I knew something about search, written some MSDN articles for the previous version of SharePoint on search. But after really diving into the subject for about a week now, I found out a lot of new stuff. The chapter itself is very dev focused with a discussion on the new search admin object model, the customization of the search center, customizing the search Web Parts, of course the different techniques of executing a search query programmatically, the search Web Service and then not to forget the new option to built custom security trimmers. More than 100 pages... I hope that doesn't get trimmed :)
One of the things that has been improved a lot with MOSS 2007 is the option for administrators to customize the behavior of the search Web Parts that are available on the search page and the search results pages. Take for example the Search Core Results Web Part, one of the most important ones displaying the search results to the user:
There are a couple of options to feed the query string into this Search Core Results Web Part. One is the obvious one where the user enter the query in the Search Box (at the top). Another way of telling the Search Core Results Web Part what query to execute is the Fixed Query property exposed by it. This is interesting when for example dropping the Search Core Results Web Part on a page of a normal team site and you want to have a certain type of query executed all the time.
The setting of the Fixed Query property is done by opening the tool pane (and yes, there are a lot of options here!). The following picture shows for example how the query can be set to show the documents containing Microsoft in the text or metadata. Don't forget to set the Cross-Web Part query ID property to something else than User Query. Other properties you can set are the paging and the amount of search results you'd like to have in the list (for example 10). I also have modified the Default Results View to Modified Date so that the resuls are sorted by date. You can also turn off all of the different possible actions and links that are normally displayed.
When done, everytime you go to the page you'll get to see 10 documents related to Microsoft, sorted by date - so the newly indexed ones always are listed first. Tomorrow, I'll show you how you can quickly come up with a custom XSLT to replace the out-of-the-box look and feel for the display of the search results.
Have a good one today!