Showing posts with label Search. Show all posts
Showing posts with label Search. Show all posts

Friday, March 18, 2011

How to Add Custom Columns to the Search Results in MOSS 2007

A few years ago I demonstrated at the New Zealand Conference how to add custom metadata columns to your search results. What I never did was make a blog post about it. So let me rectify that error of mine.

To get custom columns to appear on your search results page in MOSS you will need to do a few things. First make sure the metadata field is indexed and available by adding it to the Mapped Metadata Columns in the Search Administration of your SSP. Then, recrawl your index. And finally show the new column on the search results page by tweaking some xml and xsl.

1) Get the column indexed and mapped
To do this, open up your SSP admin site either directly or via Central Admin. Then navigate to the Search Administration Page and look for Managed Columns on the left menu. There you will need to add a new managed colum which mapps your custom field. This field could be in a SQL Store indexed via BCS or in a custom list or in a custom content type. In any case I assume that you have already crawled all the content in question, otherwise this step won't work.
2) Recrawl the index
Once you have added the managed metadata colum you need to do a full crawl. Sorry, no incremental crawls will work, as only in a full crawl does the engine do the mapping of all existing fields in the index.
3) Customise the Search Results
Browse to the search results page in your Search Centre. Fastest way? Type in a search into any search box! If you farm is configured correctly that should catapult you to the correct page.
There you need to edit the page and customise the Core Search Results WebPart.

Before you edit the actual XSL Look and feel you need to tell the webpart about the new column. So first click the three dots next to "Selected Columns". You find this option under the ResultsQuery Option. (refer to above screenshot) Copy the text out of the editor into notepad. You'll get this:
Well, you won't get that exactly. It will all be on one line and illegible. Feel free to use an xml editor of your choice instead of notepad.
In that xml you now need to add the Mapped Metadata column name. Make sure you use the correct case. XML is case sensitive! Also add the name you gave the mapped column and not the source metadata column (in case these two have different names). Once you have added the column to the xml text copy it back into the popup for the "Select Columns: option.

(note the new MyCustomColumn entry at the bottom)
Once you have added the xml for the new column you can add the column to the output in the XSLT.
Click the XSL Editor button on the WebPart customisation interface (see first screenshot) and add the new field to your xsl.

Extract before you add the markup:
And now with the new data appearing right next to the description of the search result:


That's it. Copy the changed xsl back into the XSL editor popup, apply your changes to the web part and test your results by executing a fresh search which includes some of the custom metadata that you have indexed.
The next step would be to create a custom scope for your BCD indexed data, create a custom search page and search results page for that scope and go ape-shit on the search results page with loads of custom columns and custom look and feel.
Happy Customising folks!

Wednesday, November 5, 2008

People Search for WSS

Recently I attended a presentation by Ken Biswell from RedVespa and totally fell in love with their approach to People Search. He was presenting at the Wellington SharePoint Usergroup giving us insider tips and tricks for how to tackle a SharePoint project from the Business Analyst point of view and it was a great session.
So what was their approach to People Search? Simple! They generated WCMS driven profile pages which make it easy to update and copy/paste whole CVs into and created a separate content source which only indexes those pages. Thus the PM who is now looking for a person with a specific skill like ITIL or SCRUM can simply search the limited content source and get only the results that interest him/her without being bombarded with irrelevant results.
Simple, elegant and most importantly effective! Saving time keeping profiles up to date and saving time searching for key people.

Enabling WSS for Enterprise Search

Often when I present to my students the features of the search in WSS and the features of the search in MOSS I get the question "any chance we can have a free version of enterprise search in WSS?" And thanks to Microsoft the answer is yes!
http://www.microsoft.com/enterprisesearch/serverproducts/searchserverexpress/default.aspx

With Microsoft Search Server 2008 Express it is a doddle to get enterprise search up and running in your organisation. It comes bundled with the core WSS features so you can install it onto a WSS box or have it standalone. The standalone option is great for scalability as you can dedicate the server for indexing and serving search queries.

What is included that the MOSS boys have already?
  • best bets: define the perfect searchr esult for specific keywords
  • keywords: define multiple synonyms for a keyword so abbreviations also get to the correct resutls
  • authorative sources: specify who's hot and who's not in your search results
  • federated search: a great workaround for searching the BDC
  • security trimmed results: Only see the results you really have access too.
  • Query and Results reporting: find out what your users are searching for and what results they were receiving. Great for optimising the keywords to better serve your seekers.

What's missing that the MOSS boys have?

  • load balancing for search, crawling and indexing
  • People search
  • Business Data Catalog Search
  • More API options to customise search even more

What's the end result? If you have a spare windows 2003 machine with 1-2 gb of ram and a bunch of spare space for the index , hook it up to the network, install search server 2008 express within minutes and start searching your sharepoint content, your existing intranet and internet and even you sql databases and favourite RSS feeds.