开发者

How to get all items in a search scope in SharePoint 2010?

I thought I could just do something like this:

        SPQuery oQuery = new SPQuery();
        oQuery.ViewAttributes = "Scope='MyScope'";
开发者_JAVA技巧        SPListItemCollection collListItems = oList.GetItems(oQuery);

but it is pulling back a bunch of stuff that is not in the scope. Is there a different way I should be doing this?


You are confusing SPQuery, which a list querying class, based on CAML, and the search API. Take a look into FullTextSqlQuery, which is the class you really should work with.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜