Forum Discussion

Anjan_Chidige's avatar
Anjan_Chidige
Copper Contributor
Jun 15, 2024

_api/search/query doesn't seems to consider sourceid, siteid or webid or path querystring params

Hi Friends,

I am using SharePoint Online and I have 2 site collections. I am using the Search REST API and I would like to search only in one site collection. But the search is performed at tenant level always, though the sourceId or SiteId or WebId GUID or Path values are provided in the API request.

 

Site Collections

https://xxxx.SharePoint.com/sites/SC1

https://xxxx.SharePoint.com/sites/SC2 

 

Search REST API query

I have tried below queries and all results returned data from SC2 as well.

  • _api/search/query?querytext='1234'&siteId='[GUID of SC1]'
  • _api/search/query?querytext='1234'&sourceId='[GUID of SC1]'
  • _api/search/query?querytext='1234'&webId='[GUID of SC1]'
  • _api/search/query?querytext='1234'&path='https://xxxx.SharePoint.com/sites/SC1'

I am sending the query using Power Automate Flow.

 

Looking for help for fix.

 

Thanks

Anjan

Resources