Sharepoint search rest api get all results from 2 sites and filtered results from one site

matt howell 331 Reputation points
2021-09-13T18:13:32.997+00:00

My api gets all news posts from 3 sites when the managed property refinablestring05 is true:

/_api/search/query?querytext='(Path:https://xxx.sharepoint.com/sites/site1 OR Path:https://xxx.sharepoint.com/sites/site2/sitepages OR Path:https://xxx.sharepoint.com/sites/site3/sitepages ) AND SPContentType:"Site Page" AND RefinableString05:true AND PromotedState:2 AND IsDocument:True AND FileExtension:aspx'&sortlist='FirstPublishedDate:descending'&startRow=0&rowlimit=15&selectproperties='Title,Description,RefinableString05,FirstPublishedDate,PictureThumbnailURL,WebId,Path'

I need to apply an additional filter (refinablestring01) to only one of the sites, something like:

((Path:https://xxx.sharepoint.com/sites/site1 OR Path:https://xxx.sharepoint.com/sites/site2/sitepages) OR Path:https://xxx.sharepoint.com/sites/site3/sitepages AND RefinableString01:"Field value") AND RefinableString05:true'&sortlistetc

Is there a way to do this?

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,273 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,767 questions
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 32,726 Reputation points Microsoft Vendor
    2021-09-14T06:03:20.15+00:00

    Hi @matt howell ,
    Glad that you found the solution to this problem. Thanks for your sharing.

    You could accept your answer via the "Accept Answer" button, it would be helpful to others who have similar issue in the future.