In the SharePoint classic search center I search for one specific item that I know exists. Sample query
ContentType:Masterdata
I get exactly one result back. Cool. This is what I want. There is only one item in the tenant using this content type. The result is expected.
Now I want to get this result via the SharePoint REST API. I call:
https://mytenant.sharepoint.com/_api/search/query?querytext='ContentType:Masterdata'
NO results are returned. How is this possible?
I tried the REST call directly in the browser as well as with the Search Query Tool (using the same tenant admin account for all tests).
My assumption until now was: if I can find it in the SharePoint search center I can get it via REST (and vice versa). This assumption doesn't seem to hold in the cloud.
What's going on here?
Edit
As a side node: crawled properties are also not created for the fields of the content type. They should be created since all fields of my item contain values. I heard rumors about a Microsoft update to search went wrong and there are search problems worldwide. But I couldn't find any sources for this.
Edit 2
This is getting weird.
I get no results via REST using the SharePoint root URL. But I get my result when I use a site URL.
So, no result here:
https://mytenant.sharepoint.com/_api/search/query?querytext='ContentType:Masterdata'
But one result here:
https://mytenant.sharepoint.com/sites/testsite/_api/search/query?querytext='ContentType:Masterdata'
I think I'm going to open a support case. This looks like a bug.
'ContentType:Masterdata'
. Can you tryhttps://mytenant.sharepoint.com/_api/search/query?querytext=%27ContentType:Masterdata%27
?https://mytenant.sharepoint.com/search/_api/search/query?querytext='ContentType:Masterdata'
to see if you have site collection specific rules or logic that is not in your tenant root?