Hi,
you can do the following in order to accomplish what you need:
1. You will need to add a separate search WebPart (
MonoXSearchBoxWithFilter.ascx - "Filtered site search") and setup the search with only "
DiscussionSearchProvider" like this:
<
MonoX:Search
ID
=
"search1"
runat
=
"server"
Title='<%$ Code: PageResources.Title_SearchResults %>'>
<
SearchProviderItems
>
<
Search:SearchProviderItem
Name
=
"DiscussionSearchProviderOnlyBoard"
Template
=
"Default"
></
Search:SearchProviderItem
>
</
SearchProviderItems
>
</
MonoX:Search
>
2. "
Is there a way to limit the search scope to a specific discussion board or even a specific topic? " In order to filter out only Boards or Topics or Messages you can register another discussion search provider of the same type in the
web.config but with different setup. You will need to set it similar to this:
<
add
name
=
"DiscussionSearchProviderOnlyBoard"
type
=
"MonoSoftware.MonoX.SearchEngine.Providers.DiscussionSearchProvider, MonoX"
DiscussionDescriptionLength
=
"255"
BoldSearchPhrases
=
"true"
FullTextSearch
=
"false"
MaxNoOfResults
=
"100"
SearchBoards
=
"true"
SearchTopics
=
"false"
SearchMessages
=
"false"
/>
DiscussionSearchProvider.SearchBoards
DiscussionSearchProvider.SearchTopics
DiscussionSearchProvider.SearchMessages
3. To filter by specific board you will need to inherit the
DiscussionSearchProvider and override a few methods
/// <summary>
/// Initialize message filter.
/// </summary>
/// <param name="filter">Filter.</param>
protected
virtual
void
InitMessageFilter(RelationPredicateBucket filter)
/// <summary>
/// Initialize topic filter.
/// </summary>
/// <param name="filter">Filter.</param>
protected
virtual
void
InitTopicFilter(RelationPredicateBucket filter)
/// <summary>
/// Initialize board filter.
/// </summary>
/// <param name="filter">Filter.</param>
protected
virtual
void
InitBoardFilter(RelationPredicateBucket filter)
and you will need to add the following line of code to filter:
/// <summary>
/// Initialize board filter.
/// </summary>
/// <param name="filter">Filter.</param>
protected
override
void
InitBoardFilter(RelationPredicateBucket filter)
{
base
.InitBoardFilter(filter);
if
(UrlParams.EntityId.HasValue)
filter.PredicateExpression.Add(SnDiscussionBoardFields.Id == UrlParams.EntityId.Value);
}
and do the same for Topics and Messages if you want to filter by them.
Let us know if you need more help with this.
Regards