Question

I am creating a "list of content" site and use Rest API as a data source.

The query: https://sharepoint/_api/search/query?querytext='contentclass:sts_site'

works fine and I am able to get Title and Path for each site. There is also a field "PictureThumbnailURL" for each site and it always has Null value.

Where do I need to put an image so when I query the site as above, it returns this image?

Update: I changed the query to operate on sts_web. PictureThumbnailURL can be found in Central Admin - Manage service applications - Search Service Application - Search Schema - Managed Properties. I tried add a new crawled property in PowerShell:

$web = Get-SPWeb https://sharepoint
$web.AllProperties["MyThumbnail"] = "http://url.to.thumbnail.jpg"
$web.IndexedPropertyKeys.Add("MyThumbnail")
$web.Update()

and: a) map it to PictureThumbnailUrl Managed Property b) create a new Managed Property and map the above then did the full crawl.

Unfortunatelly, neither of this worked. The search result does not contain the new property and PictureThumbnailUrl is still null.

I followed the steps from here: https://nettitude.wordpress.com/2013/10/17/introducing-indexed-property-bag-in-sharepoint-2013-a-searchable-collection-of-properties/

I also tried $site.Properties, $site.AllProperties and $web.Properties but still none of my data is displayed in the search results.

Was it helpful?

Solution

You can set your logo managed property any way you like. In my case I have a special site catalog content type that stores my site info (way easier than using the property bag). What I think you are missing is that the site "preview" is a live view of the site home page in an iFrame. In my case I modified the out of the box Item_Picture display template and assigned it to my content type. Then I override the picture thumbnail and used my custom managed property to show my logo.

OTHER TIPS

Use the 'SiteLogo' property to get the site's logo. You can also limit the number of properties returned by using the following

selectproperties='Path,Title,SiteLogo'
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top