Question

Using the search api to pull content into a mobile app, what's the right way to filter the results to get news from 2 select sites? Is there a way to use the actual site name in the filter or does it have to be the "webId"? Here's the url I'd like to use to illustrate what I mean:

https://xxx.sharepoint.com/_api/search/query?querytext='IsDocument:True AND FileExtension:aspx AND PromotedState:2'&selectproperties='Author,Path,Title,Url,CanvasContent1OWSHTML'&$filter=SiteTitle eq site1 or SiteTitle eq site2
Was it helpful?

Solution

Demo:

 /_api/search/query?querytext='IsDocument=true  FileExtension:aspx  Path:https://contoso.sharepoint.com/sites/dev Path:https://contoso.sharepoint.com/ '

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top