UPDATE

Track keywords that are used in Salesforce Knowledge article searches by using the UPDATE TRACKING optional clause. Determine how many hits a Salesforce Knowledge article has had by using the UPDATE VIEWSTAT optional clause.

Update an Article’s Keyword Tracking with SOQL

UPDATE TRACKING is an optional clause that can be added to a SELECT statement of a SOQL query to report on article searches and views. Developers can use UPDATE TRACKING to track the keywords that are used in Salesforce Knowledge article searches.

1SELECT Title FROM FAQ__kav
2WHERE Keyword='Apex' and
3Language = 'en_US' and
4KnowledgeArticleVersion = 'ka230000000PCiy'
5UPDATE TRACKING

Update an Article Viewstat with SOQL

The UPDATE VIEWSTAT clause is used in a SELECT statement to report on Salesforce Knowledge article searches and views. You can get a view count for every article that you have access to online. Developers can use UPDATE VIEWSTAT to update an article’s view statistics.

You can use this syntax to increase the view count for every article you have access to online.

1SELECT Title FROM Knowledge__kav
2   WHERE PublishStatus='online' and
3   Language = 'en_US' and
4   KnowledgeArticleVersion = 'ka230000000PCiy'
5   UPDATE VIEWSTAT