I ran into a very weird issue that caused me a real headache when using SharePoint Search API !
Below is the code I was using :
FullTextSqlQuery fts = new FullTextSqlQuery(site); fts.QueryText = "SELECT AccountName FROM portal..scope()…"; fts.ResultTypes = ResultType.RelevantResults; fts.RowLimit = 100; ResultTableCollection rtc = fts.Execute();
When the last line executes, an exception is thrown with the following message :
The specified network name is no longer available. (Exception from HRESULT:
0x80070040), Exception Stack Trace : at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(
Int32 errorCode, IntPtr errorInfo) at Microsoft.Office.Server.Search.Query.FullTextSqlQuery.Execute()
I have also received the following error in the SharePoint Trace Logs:
10/05/2009 20:03:10.18 OWSTIMER.EXE (0x0850) 0x08D0 Search Server Common MS Search Administration 0 High Log Query: More Information: The specified network name is no longer available.
Additionally, I have seen this error in the Windows Application log of the SharePoint web front end server:
Office Server Search EventID: 10038 Level: Error Query machine ‘<ServerName>’ has been taken out of rotation due to this error: The specified network name is no longer available. 0x80070040. It will be retried in 15 seconds.
Resolution:
This problem may occur because of an error in Windows Server 2008. If you use the TransactNamedPipefunction to request more than 8,000 bytes of data, Windows Server 2008 does not transfer the data correctly. To solve this issue, install the hotfix from KB 946487 on all Windows Server 2008 machines in the SharePoint farm, this will do the trick!
Hope this helps 🙂