Microsoft.Office.Server.Search.REST.SearchServiceException

Contributor

Dear Ladies and Gentlemen,

 

I receive this Exception:

Microsoft.Office.Server.Search.REST.SearchServiceException

when I try to execute following code in SharePoint Framework in SharePoint on premise:

 

let restApiUrl: string = context.pageContext.web.absoluteUrl + "/_api/search/query?querytext='Test'";

 

let config: SPHttpClientConfiguration = new SPHttpClientConfiguration({

        defaultODataVersion: ODataVersion.v3

    });

 

context.spHttpClient

        .get(restApiUrl, config, { headers: { Accept: "application/json;odata=minimalmetadata;charset=utf-8"}})

        .then((response: SPHttpClientResponse) => {

 

Thank you for your help.

 

With best regards

Ladislav Stupak

0 Replies