Search query SP - 2019 on prem is giving error "An unknown error occurred"

Pankaj Kumar 26 Reputation points
2021-03-10T14:03:25.373+00:00

Hi All, We are trying to call REST API for search query on SP-2019 on prem, getting error "An unknown error occurred", but for SP-2019 online, it is working, please find attachment in details.

SP -2019 - on prem - error log
SharePoint Foundation CSOM ahjq1 High Exception occured in scope Microsoft.Office.Server.Search.REST.SearchService.postquery. Exception=Microsoft.Office.Server.Search.REST.SearchServiceException: An unknown error occurred. ---> Microsoft.Office.Server.Search.Query.InternalQueryErrorException: Search has encountered a problem that prevents results from being returned. If the issue persists, please contact your administrator. at Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy.IssueImsDirectQuery(QueryProperties properties, _ImsQueryInternalType imsService, ConstellationLoadBalancer loadBalancer, Stopwatch sw, Action1 postProcessResultTable, Action1 logSuccess, Action1 logFailure, Boolean echoEnabled) at Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy.ExecuteInternal(QueryProperties properties, SearchServiceLogEvent logEvent) at Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy.Execute(QueryProperties properties) at Microsoft.Office.Server.Search.Administration.SearchServiceApplicationProxy.Execute(QueryProperties properties) at Microsoft.Office.Server.Search.Query.Query.ExecuteQuery() at Microsoft.Office.Server.Search.Query.SearchExecutor.ExecuteQueryInternal(Query query, SearchExecutorLogEvent evt) at Microsoft.Office.Server.Search.Query.SearchExecutor.ExecuteQueryInternal(Query query, SearchExecutorLogEvent evt) at Microsoft.Office.Server.Search.Query.SearchExecutor.ExecuteQuery(Query query, SearchExecutorLogEvent evt) at Microsoft.Office.Server.Search.Query.SearchExecutor.ExecuteQuery(Query query, SearchExecutorLogEvent evt) at Microsoft.Office.Server.Search.Query.SearchExecutor.RunWithRemoteAPIsPermission[T](Func1 f) at Microsoft.Office.Server.Search.Query.SearchExecutor.ExecuteQuery_Client(Query query) at Microsoft.Office.Server.Search.Query.SearchExecutor.ExecuteQuery_Client(Query query) at Microsoft.Office.Server.Search.REST.SearchService.<ExecuteQuery>b__e(KeywordQuery query) at Microsoft.Office.Server....76343-header.jpg

76384-body1.jpg76385-response1.jpg

76745-spserviceinstance1.jpg76670-querytoolresponse1.jpg

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,258 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jerryzy 10,566 Reputation points
    2021-03-11T07:19:51.787+00:00

    Hi @Pankaj Kumar ,

    I suggest you can check if the search service application is running, as from the error " Microsoft.Office.Server.Search.Query.InternalQueryErrorException: Search has encountered a problem that prevents results from being returned", it seems there is some issue on the search query.

    And you can also test keyword query in search results web part or Search Query Tool to see if it works to return search results.

    Thanks
    Best Regards


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.