Requirement: Add new property to advanced search drop-down in SharePoint Online.
SharePoint Online: How to Add a Property to Advanced Search Drop Down?
To perform search queries based on a specific column value in SharePoint, we can use “Advanced Search”. By default, you can search against any managed property such as “Author:Some Name” in SharePoint. SharePoint Online advanced search properties drop-down with default values such as “Created by”, “Name”, “Size”, etc. To add your custom column to this drop-down, follow below steps:
Step 1: Get the Managed Property to add to advanced search properties
We need the metadata column created as managed property in order to list it in advanced search page properties drop-down. Unlike SharePoint On-premises, SharePoint Online automatically creates managed property for Site Columns during crawling, if the column has values in it!
Edit the automatically created managed property to map additional fields and set an alias for the managed property. You may have to create a new managed property by mapping existing crawled properties, if not listed on this page.
Step 2: Edit Advanced Search page and Add Managed Property to the Schema
The Properties popup page gives XML schema for all properties listed in Advanced search page. Copy-paste it to any XML editor as it would be easier. Here I’ve copied the schema to an XML file, opened it in “SharePoint Designer” and re-formatted the code for better usability.
Add the entries to <PropertyDefs> and in <ResultTypes><ResultType> nodes
Now, You should see the new column added to properties drop down in Advanced Search page!
Wait for the “Crawl” to run on your SharePoint Online site (or reindex the list or library manually) and you can perform search queries based on the custom property.
Here is my another article written for SharePoint On-Premises: Adding Custom Properties to SharePoint Advanced Search