Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Do you know why this query doesn't return any results?

  Asked By: Celia    Date: Aug 05    Category: Sharepoint    Views: 1094

I am trying to write a Customized Search Web Part. The simple code
as mentioned over here is not working for some reason -

Dim context As ServerContext = ServerContext.GetContext
("SharedServices1")
Dim tstquery As Query.FullTextSqlQuery = New
Query.FullTextSqlQuery(ServerContext.Current)

tstquery.ResultTypes = Query.ResultType.RelevantResults
tstquery.EnableStemming = True
tstquery.TrimDuplicates = True
tstquery.QueryText = "SELECT preferredname, firstname,
lastname FROM Scope() Where ""Scope"" = 'People'"
Dim results As Query.ResultTableCollection = tstquery.Execute
()
writer.Write(results.Count)
writer.Write("<br>")
Dim resultTable As Query.ResultTable = results
(Query.ResultType.RelevantResults)
resultTable.Read()
writer.Write(resultTable.FieldCount)
writer.Write("<br>")
'writer.Write(resultTable(
If resultTable.RowCount = 0 Then
writer.Write("No Rows Returned.")
Else
If resultTable.Read() Then
If resultTable("ManagerName").ToString <> "" Then
writer.Write(resultTable("ManagerName"))
End If
End If
End If
tstquery.Dispose()

Has anyone experienced this issue? Even if I remove the Scope in
where clause it doesn't return any results.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Alexandra Patterson     Answered On: Aug 05

I thought we had setup the crawl. That was
missing. Once the crawl was done it started working.

 
Didn't find what you were looking for? Find more on Do you know why this query doesn't return any results? Or get search suggestion and latest updates.




Tagged: