Im trying to create a view for most viewed articles. I tried with entryCount plugin as recommended here
but unfortunately, when you have more than 500 articles in the last 3 weeks that I'm checking, the plugin becomes really slow.
So i had an idea to do something like this:
With each entry view, I'm incrementing the counter
seq('views:' ~ entryId, next=true)
and then i have partial where im querying posts like this
{% set lastWeek = date('3 days ago')|atom %}
{% set limit, eager = 6, [['entryCover', {withTransforms: ['cover', 'desktopCover']}]] %}
{% set entries = craft.entries.section('vijesti').dateUpdated(">= #{lastWeek}").with(eager).orderBy('views ASC').limit(limit).collect() %}
I need to introduce an additional parameter (seq) to query and sort by highest value.
Thanks in advance