tags:

views:

105

answers:

2

I am trying to call SearchListItems to progamatically get search results. 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.

+2  A: 

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

x0n
How does one enable FullText search in Central Administration?
Mike Polen
operations > services on server
x0n
A: 

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.

Mike Polen