0

I just installed a testing environment with SharePoint 2010 and FAST Search Server as the default search service application. Started with some test content and executed a few searches using the std. SharePoint GUI - everything fine so far.

Now I want to execute a more complicated query using the Microsoft.Office.Server.Search.Query.FullTextSqlQuery class and things get nasty. I get an exception when I try to access the ResultTableCollection object returned by my search.

This is the PowerShell Script I'm trying to run:

$site = New-Object Microsoft.SharePoint.SPSite "http://moss"
$kq = New-Object Microsoft.Office.Server.Search.Query.FullTextSqlQuery $site
$kq.ResultTypes = [Microsoft.Office.Server.Search.Query.ResultType]::RelevantResults
$kq.RowLimit = 5
$kq.QueryText = "SELECT Title, Url"
$resultTableCollection = $kq.Execute()
$relResultTable = $resultTableCollection.Item([Microsoft.Office.Server.Search.Query.ResultType]::RelevantResults)
And this is the exception (thrown by the last line of code above):
The given key was not present in the dictionary.
System.Collections.Generic.KeyNotFoundException at System.ThrowHelper.ThrowKeyNotFoundException() at
System.Collections.Generic.Dictionary`2.get_Item(TKey key) at
Microsoft.Office.Server.Search.Query.ResultTableCollection.get_Item(ResultType requestedType)

The very same script works perfectly when I execute the search using the std. SharePoint Search Service application. I found one related post here that stated the security trimming of the query results could be the source of my problems. However, I cannot see how this should be relevant in my environment since the service account of my FAST Service Application definitely has sufficient permissions on the AD.

Any suggestions?

solaria
  • 11
  • 4

2 Answers2

0

This API uses the full text search capabilities in SQL Server. You have to have that turned on at the SQL Server layer.

That API will not integrate with FAST. You can use FAST but you will end up using an API that makes http requests to the QR server.

Jeff
  • 5,913
  • 2
  • 28
  • 30
0

I wont claim credit for it, but this URL seems to be what you're after http://fianbakken.com/wordpress/?p=41

FQL is a fairly basic language with simple operations, AND, OR etc but can definitely make some killer queries that will do what you want.

Was trying to dig up some publicly available FQL reference for you but couldn't find any. If you need more help, give a shout.

Cheers

Ken

Ken Faulkner
  • 221
  • 1
  • 5
  • 10