Our SharePoint environment is configured with SharePoint Search as the default search option and FAST Search as the secondary search option.

We have a bunch of host header site collections which are dependent on SharePoint Search and have a few new ones which need to work against FAST. One of our tenants (site collection) have developed custom webparts to work against the FAST service proxy directly.

Now for another new site collection, is there a way to switch the Search provider in the OOB webparts?

Upon doing some research, I have found the SearchResultsBaseWebPart.DefaultSearchProvider property which is read-only. Does anoyone know of a way to set this property (maybe via reflection) so that it can works against a non-default Search provider?


The way you specify a non standard source for your search is by setting the Location property.

The DefaultSearchProvider can't be set as it's just a convenience property to easily get the DefaultSearchProvider of the current contexts search application.

But the only thing the DefaultSearchProvider property is used for is setting the Location if not specified.

The code used for setting the Location is something like:

if (DefaultSearchProvider == SearchProvider.FASTSearch)
    return "FASTSearch";
return "LocalSearchIndex";

The problem is that setting the location property won't help because there are many places in the SharePoint source code where values are hardcoded (they uses either Default or FASTSeacrh and lacks the custom option). I don't have the necessary source code nearby but you can use reflector to find it. That's why we ended up with writing custom search result web part instead of using custom search provider for FAST.

P.S. If the any CU that changes this feel free to comment this answer.

  • It seems counter productive to have to write your own webparts when the OOB one works with both SharePoint Search and FAST Search. If it is just a matter of pointing it to the non-default provider, I am hoping someone can ideally point out how you can override the default search provider to be able to set the Search provider to a non-default one. I have a thread open into this issue at: social.msdn.microsoft.com/Forums/en/sharepointsearch/thread/… May 7 '12 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.