We have 2 blogs, on different sites, on our intranet. On the homepage, we use a content by Content Search Web Part because we'd like to show a top 5 list of the most read/viewed posts (from either of those 2 blogs), during the last 7 days. Each blog post has its own Content Type (let's say A and B for this example).

Problem is it does not seem to work: when a post is just published it already immediately appears in that top 5 list, at the top. This cannot be correct.

Any idea what we might be doing wrong and what's the proper way to show this?

Here's our configuration:

Result source: Local SharePoint Results

Query: (ContentType:"A" OR ContentType:"B") (RefinableDate02>={Today-7}) (where RefinableDate02 is a custom managed property of type Date&Time, mapped to the ows_PublishedDate crawled property (the date the post was published).

Sorting: ViewsRecent (descending)

The Test tab in the search query window of the content search web part shows the following:

(ContentType:"A" OR ContentType:"B") (RefinableDate02>=2015-12-17) -ContentClass=urn:content-class:SPSPeople

  • Where is the read-count info? – Danny '365CSI' Engelman Dec 24 '15 at 9:07
  • 1
    Not sure what you mean by "read-count" or where to get that. From what I read online I thought the "ViewsRecent" property contained the info regarding hits/views of an item. Hence, sorting in descending order would automatically give me a list of most-viewed to least-viewed, or so I thought. Do I need to configure something else/extra to make it work? – Piet Schat Dec 24 '15 at 9:21
  • I am no search expert, but I think the sorting is applied to search results, so it does not effect your Query resultset... One other thing to check, Are the values for ViewsRecent correct? (show or trace them in the DisplayTemplate) – Danny '365CSI' Engelman Dec 24 '15 at 10:01
  • Did you try sorting with ViewsLifetime property. – Unnie Dec 24 '15 at 18:29
  • Thanks for the suggestions but no luck so far: the result set itself is correct: all posts are indeed published within the last 7 days, which is what we want to see. All the values of the properties also seem correct (checked it with the diagnostics view of the template). And I also tried sorting with the ViewsLifetime property: it does not make a difference with the ViewsRecent property: the sorted order remains the same. – Piet Schat Dec 28 '15 at 7:58

Your Answer

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

Browse other questions tagged or ask your own question.