How to filter sharepoint online queries KQL document libraries based on additional new column

Jeremy Wolfgank 26 Reputation points
2021-05-25T09:05:52.58+00:00

Hii There,

I have a office 365 sharepoint site, with multiple document libaries,
in each document libaries, i add new column, with name "Doc Type" and it's a choice (Procedure / Work Instruction)

how can i get all document on site, in document libaries with "Doc Type" value "Work Instruction" ?

For now i use highlighted content, so it can display all document on sharepoint site, but i don't know how to filter in query (KQL) based on Doc Type values,

anyone can help?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,715 questions
0 comments No comments
{count} vote

Accepted answer
  1. Allen Xu_MSFT 13,831 Reputation points
    2021-05-26T06:17:34.14+00:00

    Hi @Jeremy Wolfgank ,

    You have to find the name of column "Doc Type" mappped to managed property in SharePoint search schema. It will take hours after adding the column to the library to wait for the column to be crawled and mapped to a managed property. I would suggest you create a site column named "Doc Type" and add it to your library. Or if you create a column directly in the library, you have to index it or map it manually from crawled property to managed property.

    As per my test, I created a choice type site column named "DocType"(no blank between "Doc" and "Type") and added it to a library, I found it was mapped to a managed property named "DocTypeOWSCHCS" after several hours.
    99742-image.png
    99743-image.png
    I used the KQL text: DocTypeOWSCHCS: "Procedure" and then I got what I want in the highlighted content web part.
    99677-image.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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 additional answer

Sort by: Most helpful
  1. Jeremy Wolfgank 26 Reputation points
    2021-05-26T10:54:31.217+00:00

    Thanks @Allen Xu_MSFT

    Your answer seems plausible, i already create site column, and using it on document library additional column.
    now just wait for showing on managed property, before querying it.

    Many thanks

    0 comments No comments

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.