---
schema_version: "1"
id: 3a168c2f8b116ae8f88f42c70a1298f6d9692a2b7e9410d70ca0f3839e544e4a
title: Update an Article’s Viewstat with SOSL
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-soql-sosl/guides/soql-sosl/sforce-api-calls-sosl-update-viewstat.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-soql-sosl/guide/sforce-api-calls-sosl-update-viewstat.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2ab9a7a13634e70ec92b20a6ed4aeb0220b2754847a9e20c7c8c7beaafd5937e
products:
  - SOQL and SOSL Reference
  - Platform Developer Content
---

# Update an Article’s Viewstat with SOSL

Determine how many hits a Salesforce Knowledge article has had by using the `UPDATE VIEWSTAT` optional clause on a SOSL query. You can use the language attribute to search by locale.

The optional `UPDATE VIEWSTAT` clause is used to report on Salesforce Knowledge article searches and views. It allows developers to update an article’s view statistics. Also, the language attribute can be used to search by a specific language (locale). However, only one language can be specified in a single query. Make a separate query for each language that you want. Use the Java format, which uses the underscore (for example, fr_FR, jp_JP, and so on), to supply locales. Search the Web for “java locale codes” to get a list of supported locales.

You can use this syntax to increase the view count for every article you have access to online in US English:

```soql
FIND {Title}
RETURNING FAQ__kav (Title WHERE PublishStatus="Online" and
language="en_US" and
KnowledgeArticleVersion = 'ka230000000PCiy')
UPDATE VIEWSTAT
```
