SOLVED

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

Copper Contributor

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

2 Replies
best response confirmed by Anjan_Chidige (Copper Contributor)
1 best response

Accepted Solutions
best response confirmed by Anjan_Chidige (Copper Contributor)