Blokjes

Blokjes

Thursday, December 6, 2012

FASTMaxNumberOfFilters

The case

You either run into this issue in the ULS log:
12/06/2012 13:34:27.23 w3wp.exe (0x2E30) 0x35D0 SharePoint Server Search Query dn1p Medium Filter category FASTMaxNumberOfFilters in the config is in wrong format.Input string was not in a correct format. 20932873-e591-4a68-ba36-7541401c2fea
...or you face a problem like this:

You're using FAST Search Server 2010 for SharePoint and you want to remove the limit of filters returned for a single refiner. Unfortunately you're unable to do so using the MaxNumberOfFilters property of the Category element in the configuration of the Refinement web part.

The problem

Somehow, FAST ignores the setting of MaxNumberOfFilters, or at least it ignores the value of '0' which, according to MSDN should tell SharePoint/FAST to return all filters, and not just a maximum of n.

The solution

There appears to be an undocumented attribute to the Category element called FASTMaxNumberOfFilters. I don't know why this isn't documented, but if you're using FAST it's the one to use instead of MaxNumberOfFilters. I came across this fact when I wanted my refiner to show all available filters (over 500) and it was somehow capped at 100, even though I had MaxNumberOfFilters set to 0. I had several ULS Log-errors stating that FASTMaxNumberOfFilters was not provided in the correct format, which triggered me to look further into this.
Setting FASTMaxNumberOfFilters to 0 won't be interpreted as "show all". Instead, you have to provide a positive number. In my case, I used 10000 and after that I correctly got my 500+ values instead of 100.

Example:

<Category Title="Sources" Description="The source of the document" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="1" NumberOfFiltersToDisplay="0" MaxNumberOfFilters="0" FASTMaxNumberOfFilters="10000" ShowMoreLink="True" MappedProperty="contentsource" MoreLinkText="show more" LessLinkText="show less" ShowCounts="Count" />