1: MOSSSearch mossSearch = new MOSSSearch();
2:
3: ArrayList Scopes = new ArrayList();
4: Scopes.Add("All http://" + strSiteURL.Host + @"/ Blogs");
5: mossSearch.Scopes = Scopes;
6:
7: ArrayList returnProperties = new ArrayList();
8: returnProperties.Add("Title");
9: returnProperties.Add("Path");
10: returnProperties.Add("Rank");
11: returnProperties.Add("Description");
12: returnProperties.Add("Created");
13: returnProperties.Add("NumComments");
14: returnProperties.Add("NumViews");
15: returnProperties.Add("NumLinkbacks");
16: returnProperties.Add("Tags");
17: returnProperties.Add("Categories");
18: mossSearch.ReturnProperties = returnProperties;
19:
20: WhereContains whereStatement = new WhereContains();
21: whereStatement.FirstWhereProperty = "Categories";
22:
23: if (!string.IsNullOrEmpty(tag))
24: {
25: WhereProperty whereTags = new WhereProperty();
26: whereTags.Property = "Tags";
27: whereTags.SearchTerm = tag;
28: whereTags.LogOperator = WhereProperty.LogicalOperator.OR;
29: whereStatement.WhereProperties.Add(whereTags);
30:
31: WhereProperty whereCategories = new WhereProperty();
32: whereCategories.Property = "Categories";
33: whereCategories.SearchTerm = tag;
34: whereStatement.WhereProperties.Add(whereCategories);
35: }
36: mossSearch.Where = whereStatement;
37:
38: SortStatement sortStatement = new SortStatement();
39: sortStatement.SortProperty = _sortField;
40: sortStatement.ResultSortOrder = SortDirection.Descending;
41: mossSearch.SortStatement = sortStatement;
42:
43: Debug.Write(mossSearch.GetSQLStatement());
44: return mossSearch.GetSQLStatement();