Monday, September 27, 2010

The little things will get you.

I was recently writing a windows forms application that would run on a SharePoint server and run a set of actions if a solution was deployed. I used the standard approach of getting the solution by its ID from the solutions in the farm.

image

When I hit the SPFarm object the Local property was null.

image

How could SPFarm.Local be null?

The project had been given x86 by default when creating it in Visual Studio, and 32-bit application can’t call the SharePoint 2010 64bit Object Model.

image

Quick change to the Platform target and its good to go.

image

image

If your finding this post and changing your platform does not fix your issue, make sure you look at your permission too. You need to have permission to access the farm.

Wednesday, September 22, 2010

Fast Search Server iFilters for Tiffs and PDFs

Yesterday I wrote about setting up the Tiff iFilter on SharePoint Server 2010. Today I tried to apply this same approach to my 2010 FAST Search Server but hit a few bumps along the way. Several Bing searches lead me to someone talking about how both Tiff and PDF should work out of the box. I uploaded several document of both types, re-crawled and never got back any full text search results. I enabled the advanced filter pack, but still no luck. I did eventually get it working though and here is how I did it.

First I added the feature mentioned in the previous post for the Windows Tiff iFilter on the Fast Server.

image

Now that the feature is installed it will need to be registered. To register a iFilter for Fast server go to the formatdetector directory and edit the user_converter-rules.xml file.

image

I followed this article by Microsoft to register the tiff iFilter as a custom iFilter. I used this list by w3schools to get the mimetype reference needed to build my xml configuration.

image

After making your changes to the file make sure you keep a backup. If you ever install a Fast\SharePoint update or Service pack this file will be overwritten. This file is not backed up via the normal Fast\SharePoint backup procedures.

If you only care about Tiffs then you can run this power shell command (psctrl reset) on the Fast server and then re-crawl to get your full text search results.

image

To add PDF support download the latest PDF iFilter from adobe. At the time of this article it was this. Install the PDF iFilter on the Fast Server. Run the power shell command show above and then re-crawl all your content.

Now all PDF and Tiff documents should return full text search results.

image

Tuesday, September 21, 2010

Setup the TIFF iFilter for SharePoint 2010

If your running SharePoint 2010 on Windows Server R2 or Windows 7 the Tiff iFilter is a great add on that will OCR all your scanned Tiff files. The feature is turned off by default due to the additional load it can put on processing, but its easy to enable and greatly benefits searching.

The first step to enable the iFilter is adding the feature to the server. This is done through Server Manger. Click on Features in the tree and then Add Features on the right.

image

Check the box next to Windows Tiff IFilter.

image

Click next to confirm your selection then install the feature.

Now the the feature is installed it needs to be enabled and configured. Click on the start button and type gpedit.msc into the search window to launch the local group policy editor.

image

Under Computer Configuration select Administration Templates, then select the OCR folder.

image

This is were you will configure OCR for Tiffs.

image

The first option is to force OCR for all pages in a tiff. The TIFF iFilter attempts to optimize performance by skipping blank pages or pages that have non-textual content such as pictures. In my scenario almost every tiff was an invoice so I enabled this to ensure that no pages were missed during the OCR process.

image

The next setting is for the OCR language that you wish to check for. By default this will be the server system language, however if you have several different languages that you are expecting you can enable them here as long as they are part of the same code page. For example you could check for English, Dutch, French, and Italian since they all belong to the Western European code page. If you wanted to look for Japanese and English though you would have to use some other means of OCR since the Tiff iFilter does not support using more than one code page. Since I was only using English Tiff I left this setting as “Not Configured”.

image

If you have already installed SharePoint prior to these steps you will need to restart the associated SharePoint services. I was using a stand alone development environment so I was able to just reboot my server.

Now that you have the Tiff iFilter installed a full crawl will need to be run to OCR the documents. To run a full crawl open up central administration and click on manage service application.

image

Click on Search Service Application.

image

Under crawling click content sources.

image

Start a full crawl.

image

Once the crawl has finished go to your document library and search for some text that should be in one of your tiffs to see if everything worked.

image

Results!

image

Getting full text search results from the OCR data collected by the Tiff iFilter is easy, free, and a greatly improves searching in SharePoint 2010.