Tuesday, November 30, 2010

Increasing the summary length in FS4SP

In the settings for the Core Result Web Part you have the possibility to set the length of your hit summary. The default is 185 characters, and the upper limit seems to be somewhere around 400 when running against FAST Search Server 2010 for SharePoint.
image

Friday, November 26, 2010

XSLT creation revisited for SharePoint 2010 Search and a small search tip

Search tip

If you search with only a hash “#”, then you will do an empty search and all results are returned.
When modifying the xslt for the Core Search Result Webpart it’s nice to know what data is actually included in the xml.
SharePoint 2010 has a section called “How to: View Search Results XML Data” which also existed for 2007. This time around it has included the important (obsolete for HTML5) XMP tag which makes rendering xml a breeze. Best practice is to use the PRE tag, but then you have to html encode your tags for it to render correctly.

Friday, November 12, 2010

Creating Zip files with System.IO.Packaging namespace

Originally created to support working with Open Office Xml documents, it’s possible to use this namespace to create zip files as well.
The only drawbacks I have found is that you end up with an additional xml file at the root of your zip file called [Content_Types].xml which lists the mapping of file extension to mime type, and you cannot have spaces or non-ascii characters in your filenames.
If you can live with this, there is no need to rely on an external library.

Thursday, November 11, 2010

Why the Enterprise Search Web Parts are sealed

I can’t claim to know the real political reasons behind this, which according to Corey Roth’s blog post last December is because “it’s by design”. In my mind “by design” is not a real reason.
For non .Net programmers, a sealed web part means that you cannot inherit from it, doing your own customizations.
So, why are they really sealed?

Thursday, November 4, 2010

Reading Excel Sheets (xlsx) with .Net

The most common way to read Excel sheets up until recently was to use ADO.Net with the ACE OLEDB driver. It works, but you have to install the latest drivers etc., and isn’t it time to do it differently.
Third party solutions aside like Aspose, it’s possible to do this with all native .Net code. As many may or may not know, C# 3.0 introduced the System.IO.Packaging namespace used to work with Office Open Xml format, used by Office 2007 and newer. Files with docx, xlsx and pptx are all created in this format, and are basically zipped xml file structures. Rename a xlsx file to zip, and open it in your favorite zip browser and you will se something like this:
zipxlsx