0

Good Day! I have the List on SharePoint Site. It’s enabled for showing in search results. I see its elements in Search Results Page. I would like to show my custom column values in Search Results. The column name is “FTP_Path”. Type is single line text 1. I looked this article https://docs.microsoft.com/en-us/SharePoint/search/how-to-display-values-from-custom-managed-properties-in-search-resultsoption-1 2. I created Management Property named FTPPath with Search ability enabled. I added the crawled property ows_FTP_Path as mapped crawled property 3. I go to the Site Setting -> Master Page Gallery -> Display Templates/Search and locate the Item_Default.html file 4. Copy the Item_Default file and rename it to Item_Copy 5. Open the file in a text editor and find the title tag. Change the title to TEST. 6. At the end of ManagedPropertyMapping tag I added ,'FTP_Path':'FTPPath' 7. Updated Table tag as follows

            <table>

                    <tr>
                                                                                    <!—Some Another Item Properties -->
                            </tr>

                    <tr>
                    <td class="ftp">
                    _#=ctx.CurrentItem.FTP_Path=#_
                    </td>
                    </tr>
            </table>
  1. I told SharePoint to use my new Item_Copy template. It is working fine.

And I can’t see FTP_Path column values in Search results…

When I look my search results page by FireBug, I see that td tag with “ftp” class is empty on the page.

I looked this article https://www.eliostruyf.com/making-columns-searchable-for-the-list-or-library-searchbox/ and can’t understand, what is wrong. Full content crawling didn’t help. I would be grateful for any help.

0

You need to create a new result type to get custom managed properties in search results and then click update result type. Go to Site settings --> Search Result Types and copy the SharePoint List Item.

See this blog by Bella Engen https://blogs.technet.microsoft.com/tothesharepoint/2013/09/06/how-to-create-a-new-result-type-in-sharepoint-server-2013/

| improve this answer | |
0

While creating the new managed property you need to check the Retrievable property of it to enable the Column to appear in Search results.

enter image description here

And do not forget to do a full crawl after a new managed property is created/modified.

Then add the managed property in the mapping in the display template like

<mso:ManagedPropertyMapping msdt:dt="string">'Title':'Title','<Current item property name>':'<Managed property name>'</mso:ManagedPropertyMapping>

So in your case it will be

<mso:ManagedPropertyMapping msdt:dt="string">'Title':'Title','FTP_Path':'ows_FTP_Path'</mso:ManagedPropertyMapping>

Then you can fetch the column in the search results like you have mentioned

_#=ctx.CurrentItem.FTP_Path=#_

Hope that helps..

| improve this answer | |
-1

Thank you very much! I found my error.

I updated the string in my Item_Copy template

_#=ctx.CurrentItem.FTP_Path=#_

to

 _#=ctx.CurrentItem.FTPPath=#_

And it is working!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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