
“Advanced Search” is a great feature, although not utilized in many cases. Out-of-the-box, it provides a default set of available options, which are too general for most businesses. However, it can be enhanced with some easy customizations.
In this post, I’m going to demonstrate one of the most powerful configurations of “Advanced Search” in SharePoint 2013/2016 and Office 365: how to add our custom property filters.
The steps to follow:
0) Make sure the property you want to work with does exist as a Managed Property.
1) Open the “Advanced Search” page (usually the URL is http://[your-search-center-url]/Pages/advanced.aspx
2) Click on “Edit” page.
3) Once in edit mode, open the “Advanced Search” box web part’s properties.
4) In the web part properties, open the “Properties” tab, and you’ll see an XML there in this crazy, impossible-to-edit format:
5) Open this XML by clicking on “…” next to it. Select all and copy to a good editor, like NotePad++, and format as XML. You get something like this:
6) The sections of this XML are:
- Languages: feel free to remove the languages which are not relevant to your search.
(Note: However, don’t touch the LangDefs in the beginning!) - PropertyDefs: You can define what properties you want to use on “Advanced Search.” For example, let’s add a property named TrainingID:
- ResultTypes: To add TrainingID to each result type where it’s relevant, add a new PropertyRef entry as shown below:
7) When you’ve added it to each result type you wanted, linearize the XML, select all and copy the whole XML to the clipboard, and then back to the editor in the web part properties.
8) Click OK in the editor. Click OK on the web part’s properties, then save the page.
Your custom property (Training ID) is available in the property filter drop down now.
hi,
The web part (search advanced) does not give any results on sharepoint 2019 (standart )(in classic mode) after migration of sharepoint 2013 enterprise to 2016 and 2019 (standart)
Can you please advise how this may be resolved.
Thank you
It’s very hard to answer this question without knowing the details. Does normal query search work? Have you tried to create a test search center from scratch? Does that work?
There is a way to config these XML properties on runtime instead of on design time?
Not without custom development.
Hello
What can I do if I don’t have advanced.aspx in my published site?
Thank you in Advance
Is it a search center, David?
Any way to make the displayed property values to sort in alphabetical order?
Hi,
I have implemented the Advanced Search correctly I believe. Although, properties that are “Choice” columns do not produce any results. For example, I have a column called “Asset Type” that contains four value choices (SCOP, SOP, Job Aid, Reference Material). When I choose the property “Asset Type” “Contains” or “Equals” “SCOP”, I get no results. Can you please advise how this may be resolved? I will be forever in debt to you. Thank you.
Please go ahead and check with the Search Query Tool what is in your Managed Property for that choice field. “Equal” is a tricky one, you have to use the exact value.