none
Cannot Get search results from SearchExecutor from webjob.

    Question

  • Hi,

    I have a problem with the SearchExecutor and right now I don't have anymore options to find the issue.

    I have a webjob running on an azurewebsite that peforms search queries.

    I have 2 tenants where this job is running fine and 1 tenant where I get the following error.

    [02/25/2016 06:41:24 > 034c7a: ERR ] Unhandled Exception: Microsoft.SharePoint.Client.ServerException: Search has encountered a problem that prevents results from being returned.  If the issue persists, please contact your administrator.
    [02/25/2016 06:41:24 > 034c7a: ERR ]    at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
    [02/25/2016 06:41:24 > 034c7a: ERR ]    at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
    [02/25/2016 06:41:24 > 034c7a: ERR ]    at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
    [02/25/2016 06:41:24 > 034c7a: ERR ]    at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
    [02/25/2016 06:41:24 > 034c7a: ERR ]    at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
    [02/25/2016 06:41:24 > 034c7a: ERR ]    at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()

    I have eliminated the query as the problem as I changed the query to Title:*

    It still gives the same error.

    Right now the error happen on clientContext.ExecuteQuery in the following code:

     

    var searchExecutor = new SearchExecutor(clientContext);
                var results = searchExecutor.ExecuteQuery(qry);
                clientContext.ExecuteQuery();

    The query itself is built like this:

    var keywordQuery = new KeywordQuery(clientContext)
                {
                    QueryText = "ContentType:\"SOX Archive Item\"  SoxArchiveStatusOWSCHCS:\"" + status + "\""
                };
                keywordQuery.SelectProperties.Add("Title");
                keywordQuery.SelectProperties.Add("ListItemID");
                keywordQuery.SelectProperties.Add("SoxArchiveSiteOWSTEXT");
                keywordQuery.SelectProperties.Add("SoxArchiveYearOWSNMBR");
                keywordQuery.RowLimit = 100;
                keywordQuery.TrimDuplicates = false;
                keywordQuery.SourceId = new Guid("8413cd39-2156-4e00-b54d-11efd9abdb89");

                var results = GetSearchResults(keywordQuery, clientContext);

    Does anybody have any idea how to find this error? as it is SharePoint Online I don't have access to any logs so I am kind of in the dark here. Unless I am missing something?


    • Edited by Maesth Thursday, February 25, 2016 6:55 AM Additional info
    Thursday, February 25, 2016 6:52 AM