3

In my SharePoint 2013 environment, I am trying to display a value in my custom search results from a column in my SharePoint list.

I am working on a customized 'Default Item' search template in SharePoint Designer, to display the custom search results.

I did the following steps:

  • Created a Custom SharePoint List in a subsite, added dummy data to the list
  • Ran the Full Search crawl in the Central Admin so that the data I added could be indexed or crawled.
  • Here, I want the value in the search result to be coming from this PostURL column in the list: enter image description here

  • Then I went to the Managed property in my Site Collection Administration (as I know the a managed property needs to be created for a column in order to be displayed in search result) as shown in the attached screenshot below

enter image description here

  • In the managed property, I searched for the column name 'PostUrl' from my custom list as I wanted the data from this column to be displayed in the search result the and could not find it (looks like SharePoint doesn't automatically convert the list column to a managed property)
  • I then manually created a Managed Property against my column as shown below: enter image description here

The column name is prefixed with ows_PostURL under the 'Mapped Crawled Properties'

I then went back to my SharePoint designer, and added the Property Name 'PostURL' in the ManagedPropertyMapping section as shown in the screenshot below: enter image description here

And then I updated the Div tag in the search template to have the Managed Property name like so so it could appear in the search result.

enter image description here

For some reason, the value from that SharePoint column 'PostURL' is not appearing in my search result even after I created a managed property for that column.

Am I missing something here? Please advise.

Thank you.

5
  • If i remember it correct, SharePoint does not create managed properties out of standard added list columns. If you create a site column and use it in your list instead, SharePoint will create a managed property (after a full crawl ofc). And i think that a incremental crawl creates the crawled property, which you have to manually map to a managed property and AFTER that, run a full crawl, otherwise SharePoint won't know that you mapped the managed property to your crawled property, so try to run a full crawl again. Jun 3, 2016 at 9:20
  • Thanks for your reply Christoffer. In this scenario, I have created a column in a custom SharePoint list, I haven't created any site column. Jun 3, 2016 at 9:26
  • 1
    Are you getting correct values for Title & Description columns ? Also have you tried Re-index the list?
    – Yayati
    Jun 3, 2016 at 9:51
  • After creating the MP you have to run another full crawl. Also, is the site collection that you created the MP the same one that has the Display Template? Try a query like PublishUrl:http*. Jun 3, 2016 at 11:57
  • Thanks Yayati for your reply. Yes, I am able to get the values of 'Title' and 'Description' in my search result. Jun 4, 2016 at 11:10

1 Answer 1

4

After going through your question(which I must say well described), I figured out that only thing which you have to do is to create a custom Result Type and specify the display template(which you have already created) which this custom result type will be using.
Following are the steps to create custom Result Type.

  1. Go to Site Settings --> Search Result Types --> New Result Type

  2. Enter Name for result type.

  3. Select the Display Template which you have created.

  4. Click OK.

Lastly, make following changes to your Search Result web part.

  1. Edit Search Result web part in browser.

  2. In Display Template section --> Click on Use result types to display items

  3. Click OK.

Now you should be able to see value for PostURl Managed property in search results wherver it has value.

Note: Try to perform a full-crawl if this doesn't work for you.

1
  • You are a life saver Yayati! thank you so much for pointing this out. I was actually creating the 'New Result type' but was missing the last step to set the display template. Thank you once again. Cheers. Jun 4, 2016 at 13:40

Your Answer

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

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