Result search query to exclude items without values in a managed property

New Contributor

Hi all,

I am trying to configure a PnP Search Results WebPart to show all recently modified site pages that contain a value in a managed property, any value that isn't blank.

 

For context, this is for a wiki SharePoint site where all users can make changes and submit for approval. After they are approved, I would like to show on the home page the most recently updated pages.

What I would like the query to do:

Search for all pages from the path below that contain any value in the RefinableString00 property.

 

path:https://xxx.sharepoint.com/sites/wiki/

 

A refinement filter is also set in the WebPart so that results only show site pages:

FileType:aspx

Results are also sorted to show the most recently updated pages first, using the property:

LastModifiedTime


My issue is that there are pages that don't have a value in the managed property RefinableString00 showing. I would like for these pages to not show.

The question being how would I achieve this? Any suggestions would be appreciated

2 Replies
Did you manage to find a solution for this?

Hi Gurdev,

I managed to find out that my query is achievable by configuring the following in the PnP Search Results WebPart:

 

  • Available data sources
    • Layout slots

SILChristianDias_1-1660656066705.png 

  • SharePoint Search
    • Query template:
    • Result source ID:
      • ItemsMatchingTag
    • Selected properties:
      • RefinableString00
      • ModifiedBy
      • ModifiedById
      • LastModifiedTime
    • Sort order
      • Field name:
        • Last ModifiedTime
      • Direction:
        • Descending
    • Refinement filters:
      • FileType:aspx
    • Enable query rules
      • On
    • Enable localization
      • On
  • Available connections
    • Use input query text
      • Static value
        • Query text
          • {|RefinableString00:{Page.WikiCategory}}

With some visual tweaking this is the result:

SILChristianDias_2-1660656603994.png

 

@Gurdev Singh