How is Knowledge v3 "Most useful" calculated?

hussra
Tera Contributor

The "Featured content", "Most useful" and "Most viewed" sections in Knowledge v3 are great. I'm wondering quite how the "Most useful" section is evaluated - seems to be related to clicks on the "Helpful? Yes/No" buttons, but it would be handy to know quite what is being calculated.

It doesn't seem in my limited testing to be just based on the articles with the highest number of "Useful" ratings. Is it based on number of "Useful" minus number of "Not useful" ratings? Or something more complex again? I've not managed to track down the code that generates this data.

1 ACCEPTED SOLUTION

Total likes, not a percentage. saruppaul can correct if I'm wrong, but that's my understanding.


View solution in original post

9 REPLIES 9

Thanks for the info - will add this to our CMS block once that is working as intended.


The context is that I'm looking to see what we can reasonably add to our public knowledge search, while waiting for the full Knowledge v3 functionality to become available to non-logged-in users.


Have you looked at pinned articles?


Yes, I've got a CMS block to reproduce the pinned articles list thanks, just wondering what else we might be able to offer our unauthenticated users.


tim2222
Tera Expert

An old post but for others looking for the specific location of this data it is kb_feedback.useful.

(function() {
	var gr = new GlideAggregate('kb_feedback');
	gr.groupBy('article');
	gr.addQuery('useful', 'yes');
	gr.addAggregate('COUNT', 'article');
	gr.orderByAggregate('COUNT', 'article');
	gr.query();
	var art = new GlideRecord('kb_knowledge');
	gs.debug([art.getElement('number').getLabel(), art.getElement('short_description').getLabel(), 'Useful Count']); 
	while(gr.next()) {
		art.get(gr.article);
		gs.debug([gr.getDisplayValue('article'), art.short_description, gr.getAggregate('COUNT', 'article')]);
	}
})();