Open the web part code (WildCardSearhResults.cs) and locate the GetFullTextQuery method. Within that method search for the following code:
// append the from clause
fullTextQuery.Append(" FROM Scope() WHERE ");
To add scopes to a full text query the syntax is WHERE "scope" = '{scope name}'
// append the from clause
fullTextQuery.Append(" FROM Scope() WHERE \"scope\" = 'People' AND " );
The AND is needed to append the other items the code generates. Recompile and re-deploy and it should work (I actually needed to Retract and Remove the solution from Central Admin). If you need various wilcard web parts to co-exist, you will probably need to change the names of everything in the original solution and create a "new" web part for the scope you are interjecting into the code.


1 comments:
I have an even better solution that makes the scope generic. It will use the Scope entry from the tool pane (under Miscellaneous).
Here is the updated code:
// append the from clause
if (base.Scope != null)
{
fullTextQuery.Append(" FROM Scope() WHERE \"scope\" = '" + base.Scope + "' AND ");
}
else
{
fullTextQuery.Append(" FROM Scope() WHERE ");
}
Post a Comment