Which Managed Property i can use to differentiate if a modern page has been published as News

john john 941 Reputation points
2021-11-12T18:05:09.15+00:00

I am developing a custom SPFx web part, which should filter search results and show the News pages that have been published as News.

Now i can use this managed property to filter the results based on the FileType:-

FileType:equals("aspx")

but this will show all the modern pages even the ones which are not published as News.. so how i can fix this? and to only show the modern pages that have been published/promoted as News pages?
Thanks

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,626 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,668 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MichaelHan-MSFT 18,016 Reputation points
    2021-11-15T02:47:41.123+00:00

    Hi @john john ,

    You could try the managed property "PromotedState", if Promoted State equal 2 page is published as News.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.