0
我有一個單詞(docx)文檔存儲在OneDrive for business上。它具有如下的結構:SharePoint搜索查詢
<title>
Book Title
</title>
<author>
High
</author>
然後我用Microsoft.SharePoint.Client搜索標題和作者
var targetSite = new Uri("https://my-site.sharepoint.com");
var login = "login";
var password = "pass";
var securePassword = new SecureString();
foreach (char c in password)
{
securePassword.AppendChar(c);
}
var onlineCredentials = new SharePointOnlineCredentials(login, securePassword);
using (ClientContext clientContext = new ClientContext(targetSite))
{
clientContext.Credentials = onlineCredentials;
var query = new KeywordQuery(clientContext);
query.QueryText = "<title></title><author></author>";
var searchExecutor = new SearchExecutor(clientContext);
var result = searchExecutor.ExecuteQuery(query);
clientContext.ExecuteQuery();
}
但它不工作。它只返回單詞標題和作者。我究竟做錯了什麼?
我想找到標籤
如果在問題中指定它會更好,因爲它不是那麼容易理解,並且也是一個相當奇怪的要求。 –