I'm trying to use the REST api on a SharePoint online site to get results that are only documents. My query string looks like this:
_api/search/query?querytext='sti*'&rowlimit=2&sourceid='e7ec8cee-ded8-43c9-beb5-436b54b31e84'&selectproperties='Path,Title,HitHighlightedSummary,FileType'
So:
rowlimit = 2
Source ID = e7ec8cee-ded8-43c9-beb5-436b54b31e84
Select Properties = Path,Title,HitHighlightedSummary,FileType
This works fine on a regular SharePoint solution, but not at all on SharePoint Online. The query always returns the exact same documents, regardless of what querytext I put in. The same are even return if I type something like 'kshdgaibl akjrhgpiauerhpiae'...
I have double checked that the source ID is correct. If I remove the source ID entierly the correct documents show up, along with other result sources. And if I go to the search center and type in the same text, I get the documents and other results.
Does anyone have an idea why this could be?