Thursday, 10 June 2010

Wildcard search in AdvancedSearchWebpart (AllowOpContains)

Hey all,

Today something about search configuration in SharePoint 2007. When you use the AdvancedSearchWebpart, you can set (custom) property definitions. This way you can search directly on one metadata (i.e. "Street"). The creation of these custom properties I will not describe in this article.
When you have created your AdvancedSearchWebpart you can start testing it. You will see that the standard fields ("All words", "Any Words", etc) will give much more results as when you use the custom properties. So when you enter "fleet" in the "All words" field, you will also get "fleetstreet". But when you enter "fleet" while using the custom property, you won't find anything. This is because the option "AllowOpContains" is set to false by default in the XML behind the AdvancedSearch Webpart.
So go to your page and select "Modify shared webpart". Then in the properties tab, locate the properties field and open the XML that is inside. On the top of the XML, you will find the line