File search in specific folder - SearchLocations


Is there any way I can get the EPiServer search (SearchDataSource) to search only in a specific "PageFiles" folder? I've tried to set the SearchDataSource.SearchLocations = "~/PageFiles/112/", but then I get an "Object not set to an instance..." error when I try to bind the result.

Any suggestions?

Aug 27, 2010 9:46

I don't think that is possible, but you could filter the result collection and delete unwanted PageFiles links. But that is maybe not the best performance optimisation advice this year :-)

Aug 27, 2010 9:57

Hm, I would rather avoid filtering the whole collection afterwards, but maybe there's no other option using the SearchDataSource... :-)

Aug 27, 2010 15:21

Well, you can always add some timers in the code and find out actually how much time the filtering takes...

How much traffic is it on the site and how many searches are executed per hour etc,

The best thing, I guess, would be not use that pagefile folder at all, but instead create a new dedicated vpp for these douments you want to search for....

In any case, good luck :-)

Aug 27, 2010 18:22

Finally we've decided to create a new vpp folder for the uploads, thanx for the advice!



Edited, Sep 01, 2010 9:52
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.