0

We have a document library that includes some images -- as well as more traditional docx, pdf, xlsx, etc. In the search results that include the images they are being displayed using the Item_Default template.

I've checked Site Settings > Search Result Types (both for the site collection and the site) and they show that results of type Image should use the Item_Picture template. But they aren't.

The main problem is that the Default template is showing a link to the display form of the metadata associate with the item.

For example:

<site>/Documents/Forms/DispForm.aspx?ID=42

That isn't very useful for the user in this case.

So a solution could go either way.

How do I get search results to provide a link to the actual image stored in a Documents library?

or

How do I get search to identify an image coming from a document library and actually match the Result type as it is set up in site settings?

0

In the past this has been the behavior for SharePoint on prem. Images in document libraries never showed thumbnails. If you put them into Picture or Asset Libraries they will work the right way.

To resolve it we would write a new display template and result type rule.

  • Any suggestions on how to do that? I know how to make (or alter a template) and I know how to set up request type rule. But the PictureThumbnailURL and PictureURL are always blank. How do I get the values to include in the result to then show with the template specified by the rule. – Rothrock Oct 25 at 15:05
  • If you aren't using a Picture Library there won't be a thumbnail generated for you. You have to construct the URL yourself from the managed properties provided. – Matthew McDermott Oct 27 at 21:53
  • I'm mostly wanting to get the link to the image. Any suggestion on how to get that url? It doesn't seem to be in any of the properties that I can retrieve with search. – Rothrock Nov 1 at 15:30
  • It should be the Path or ItemPath IIRC. – Matthew McDermott Nov 13 at 12:52
  • Path and OriginalPath both point to the Display form for the list item. In Search Schema I don't see a property called ItemPath. I also tried URLOWSURLH which is null and FileLeafRef which is not retrieved. Filename is "DispForm.aspx" – Rothrock Nov 13 at 16:00

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.