开发者

SearchListItems returns 0 results, but SharePoint search returns 5 pages of results

开发者 https://www.devze.com 2022-12-09 07:30 出处:网络
I am trying to call SearchListItems to progamatically get search resu开发者_开发知识库lts. My code is pretty simple:

I am trying to call SearchListItems to progamatically get search resu开发者_开发知识库lts. My code is pretty simple:

SPSite site = new SPSite(siteUrl);
SPWeb web = site.OpenWeb();
SPSearchResultCollection resultListItems = null;
resultListItems = web.SearchListItems(keyword);

The resultListItems return 0 items in milliseconds even though the web has 18 lists and >100K items.


Does the account you're running the code as have access to the list items? Perhaps they're being removed by the security trimmer.

If that's not it, the other possibility is that you have not enabled FullText search in Central Administration.

-Oisin


The content database did not have an assigned index server. Once one was assigned and a full crawl was complete the code worked as expected. The interesting thing is that the search worked from SharePoint at all.

0

精彩评论

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