关键字查询语言,用于从网站集中获取所有包含特定SharePoint组的项目 [英] Keyword Query Language to get all the Items holding particular SharePoint group from Site Collection

查看:60
本文介绍了关键字查询语言,用于从网站集中获取所有包含特定SharePoint组的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的

我需要从列表和列表"中获取所有项目.拥有SharePoint组名"Doctors"的整个网站集的文档库使用关键字查询语言.

I have requirement to get all the items from Lists & Document Libraries of entire site collections holding SharePoint  group name "Doctors" using Keyword Query Language.

任何人都可以帮助我该怎么做

Can any one help me how can I do this

谢谢,
优质的沟通提供优质的工作,
萨姆.

Thanks,
Quality Communication Provides Quality Work,
SAM.

推荐答案

我们可以创建一个可视化Web部件,并检查医生"中的当前用户是否分组与否.

We can create a visual web part and check whether the current user in the "Doctors" group or not.

然后使用Search API获取列表项.

Then using Search API to get the list items.

using (SPSite siteCollection = new SPSite("http://sp13/sites/test1"))
{
	KeywordQuery kq = new KeywordQuery(siteCollection);

	kq.QueryText = "SPSiteUrl:http://sp13/sites/test1 (ContentType:item OR ContentType:Document)";
	kq.RowLimit = 1000;
	SearchExecutor se = new SearchExecutor();

	var rt = se.ExecuteQuery(kq);

	var resultTables = rt.Filter("TableType", KnownTableTypes.RelevantResults);

	var resultTable = resultTables.FirstOrDefault();

	DataTable data = resultTable.Table;
}

最好的问候,

丹尼斯


这篇关于关键字查询语言,用于从网站集中获取所有包含特定SharePoint组的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆