0

I have a document library with additional columns like choice columns and managed metadata columns.

There are folders, subfolders and files.

Using SharePoint search I want to search the the files by the above columns.

I tried the following in search bar:

Columnname:keywordtosearch Columnname=keywordtosearch

Example:

Country:canada Country=canada

But this also returns files containing the word canada irrespective of whether or not the metadata columns has canada in it.

1 Answer 1

0

In SharePoint Online, you can search by choice column and metadata column using the Keyword Query Language (KQL) in SharePoint search queries. Here's how you can do it:

  1. Search by Choice Column:If you want to search for items based on a choice column, you can use the following syntax in your search query:

[ChoiceColumnName]="ChoiceValue"

For example, if you have a choice column named "Status" and you want to search for items where the status is "In Progress", your search query would be:

Status="In Progress"

  1. Search by Metadata Column:If you want to search for items based on a metadata column, you can use the Managed Property name associated with that column in your search query.First, you need to find the Managed Property name for your metadata column. You can do this by going to the SharePoint admin center or by using PowerShell.Once you have the Managed Property name, you can use it in your search query. The syntax would be:

ManagedPropertyName:"Value"

For example, if you have a metadata column named "DocumentType" and you want to search for items where the Document Type is "Proposal", your search query would be:

DocumentType:"Proposal"

Combine both types of searches if needed using the AND operator. Here's an example where we search for items where the Status is "In Progress" and the Document Type is "Proposal":

Status="In Progress" AND DocumentType:"Proposal"

You can use these search queries in the search box on a SharePoint site or in custom search solutions, such as Search REST API queries or search web parts. Make sure to adjust the column names and values according to your specific SharePoint environment and column configurations.

2
  • Is there a way to search by a column that is of the type single line of text?
    – variable
    Commented May 16 at 18:26
  • Does the columns managed property need to be mapped to the crawled property?
    – variable
    Commented May 16 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.