I have a ContentBySearchWebPart configured with this query:

{searchboxquery} Path:http://myCompany.com/sv contentclass:"STS_Site" 

I selected some display template and it looks good. Is it possible to implement some sorting? I would like to show the most populair site collections as first. I mean with populair the most hits/visitors on these site collections.


In the Sorting tab of the webparts "Change query" menu (you need to enter advanced mode to find the sorting tab) set Sort by to ViewsRecent Descendant.

This will sort your result on the number of views it has had in the last 14 days (the nubmer of views is by default calculated once a day by a timer job)

| improve this answer | |
  • thanks, is there also another way to get the most views from always and not last 14 days? – Ola Sep 23 '15 at 11:11
  • 1
    ViewsLifeTime if I'm not remembering wrong – Robert Lindgren Sep 23 '15 at 11:48
  • @RobertLindgren I need to configure for SharePoint online where ViewsRecent is not working in my case. Since ViewsRecent(Manage Property is not mapped to any crawled property).. Please help me on this – praveen Apr 19 '18 at 11:43
  • @praveen this should work fine online as well... – Robert Lindgren Apr 19 '18 at 17:09

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.