OnPrem 2013. I'm looking for a way to use a Custom Field as the Title (clickable link) in results of search. I have dug across the Internet and found many things that got me close. Here is what I tried so far:
- Create Test Site, add custom field to DocLib as single line of text. Added docs and metadata.
- Created sub-site with Enterprise Search template.
- Created Results Set that only returns from DocLib. Tested... works.
- Created a new Managed Property and mapped to Crawled Property ows_CustomField. (even copied options from Title ManProp) Reindexed site, Incremental Crawl.
- Got into copy of Item_CommonItem_Body.html and added ManProp to mso:ManagedPropertyMapping.
- Modified line 20 (as called out in many online articles) and referenced my Managed Property. No Dice.
I am able to switch the Title to other ManagedPropertyMappings already called out in the mapping such as Path, EditorOWSUSER, and more, so I know I'm doing something close. I just don't know why it doesn't like my custom ManagedProp...
For the record, I also tried adding the mapping the ows_CustomField to the 'Title' ManProp, and move it to the top hoping it would take this as the 'first non empty value'. No Dice.
Simply put, these work:
- var title = Srch.U.getHighlightedProperty(id, ctx.CurrentItem, "Title");
- var title = Srch.U.getHighlightedProperty(id, ctx.CurrentItem, "Path");
- var title = Srch.U.getHighlightedProperty(id, ctx.CurrentItem, "DocId");
This does not:
- var title = Srch.U.getHighlightedProperty(id, ctx.CurrentItem, "CustomManProp");
Hoping someone can point out what I'm doing wrong. Thanks!