question

PankajKumar-4692 avatar image
0 Votes"
PankajKumar-4692 asked PankajKumar-4692 commented

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

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, Action`1 postProcessResultTable, Action`1 logSuccess, Action`1 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](Func`1 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


office-sharepoint-online
header.jpg (105.3 KiB)
body1.jpg (80.3 KiB)
response1.jpg (34.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Jerryzy avatar image
0 Votes"
Jerryzy answered PankajKumar-4692 commented

Hi @PankajKumar-4692,

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.


· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Jerryzy-MSFT,

I have checked search service, it is showing online. And I tried Search Query Tool, but still getting same issue.

Attaching screen shot.

Regards,
Pankaj Kumar

0 Votes 0 ·

these two screen shots in above.
[4]: /answers/storage/temp/76745-spserviceinstance1.jpg
[5]: /answers/storage/temp/76670-querytoolresponse1.jpg

0 Votes 0 ·

Can you use the search function in built-in search results web part ?

0 Votes 0 ·

Hi Team,

can you please tell me, how to do that ?

Regards,
Pankaj Kumar

0 Votes 0 ·