SharePoint: Highlighted Content to filter in Content Type Data

Stacie Carlson 40 Reputation points
2024-08-20T15:18:11.89+00:00

Hello,

We have a SharePoint site for our company polices. This site has a content type attached named Company Policy, which includes the file, file name, Department, Division and Policy Owner. I am trying to use the Highlighted Content webpart on a separate page to pull in only those policies assigned to a specific department, in this case Information Technology. Within the highlighted content webpart properties, I'm choosing Custom Query, specifying the site our policies are all housed, and for the query text (KQL) I am entering contenttype:"company policy" AND companydepartment:"information technology" but it doesn't return any values. I do see there are multiple tests out on the policy site that I would have expected it to return. Please advise on what I may be doing wrong. Thank you!

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,797 questions
{count} votes

Accepted answer
  1. Emily Du-MSFT 47,296 Reputation points Microsoft Vendor
    2024-08-29T08:37:50.6133333+00:00

    Here are steps about how to use Department column to filter search results in the highlighted content web part. You could check whether you have appropriate settings.

    1.Create a Company Policy content type based on the Documents content type.

    1

    2.Insert a site column named Department into the Company Policy content type.

    23

    3.Find the managed property name of Department column.

    4

    4.In the KQL query, set the formula:olDepartmentOWSTEXT: "Information Technology".

    5

    5.Result:

    User's image

    6


    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.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Emily Du-MSFT 47,296 Reputation points Microsoft Vendor
    2024-08-21T09:53:34.8166667+00:00

    Please following below tips to troubleshoot the issue:

    1.Make sure the department column has both crawled property, managed property and queryable.

    2.In the KQL, use this ContentType:"Company Policy" AND the managed property of department column:"information technology"

    3.Use filter like following:

    1


    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.