---
sourceDocument: Xanadu ServiceNow AI Platform Administration
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/platform-administration

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Zing computes document scores using three components

# Zing computes document scores using three components {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read

The Zing search engine computes document scores based on the frequency, sequence, and weight of search terms in the document.

## Document scores

The components of a document score for a search query are:

* Frequency: how often the search terms appear in the document.
* Sequence: how often the search terms appear in the same order as the search query.
* Weight: how heavily weighted the source field is in which the search terms appear.
{#c_DocumentScoring__ul_ynr_mlj_dq}  
Figure 1. Sample document score computation

## Frequency points

Zing awards one point whenever a search term appears anywhere in the document. For example, when searching for <kbd class="ph userinput">distributed database server</kbd>, a document that contains `distributed` three
times, `database` five times, and `server` 17 times would have 25 frequency points.

To increase search result scores of search terms that appear more frequently in a document, but less frequently in a document set, you can [Score search terms by inverse document frequency (IDF)](https://servicenow-prod.fluidtopics.net/J~E3PaAA0q9kPG12u1ueiw "Enable term frequency–inverse document frequency (TF-IDF) to increase the search result scores of search terms that appear more frequently in a document, but less frequently in the whole collection of searchable documents."). When TF-IDF is enabled, search term scores are calculated by multiplying the term frequency score by the inverse document frequency score. Because enabling TF-IDF increases the weight of less
common search terms, search results for that table are more likely to be relevant. For example, when searching for <kbd class="ph userinput">distributed database server</kbd>, the term `distributed` might receive a higher
score than `server` if it appears frequently in one document but less frequently in the document set as a whole.

Zing applies a multiplier to frequency points based on the value of the ts_weight attribute for the field in which the search term appears. A field with a text search scoring weight of 30
(ts_weight=30) would add 30 points for each inclusion of a search term.

## Sequence points

Zing awards a document more points when it contains the search terms in the same order in which they were typed. The more search terms in sequence there are, the exponentially higher the score becomes. Zing awards sequence
points as 10\^x, where x is the number of search terms that appear in sequence.

In the <kbd class="ph userinput">distributed database server</kbd> search example, Zing awards a document 100 (10\^2) sequence points for each time it includes the two-term string <kbd class="ph userinput">database server</kbd>. Likewise, Zing
awards a document 1000 (10\^3) sequence points each time it includes the three-term string <kbd class="ph userinput">distributed database server</kbd>.

Zing applies a multiplier to sequence points based on the value of the ts_weight attribute for the field in which the sequence appears. The sequence points use the calculation (10\^x \* field
ts_weight attribute).

## Field scoring weights

The system elevates the default scoring weight of Knowledge record numbers, Knowledge short descriptions and metadata, task record numbers, and task short descriptions. Default ts_weight attributes for these fields are as follows:

* kb_knowledge.number = 50
* kb_knowledge.short_description = 10
* kb_knowledge.meta = 10
* task.number = 50
* task.short_description = 10
{#c_DocumentScoring__ul_exv_lmj_dq}

All other fields have a default ts_weight attribute of 1. The maximum possible weight value is 255.
* **[Score search terms by inverse document frequency (IDF)](https://servicenow-prod.fluidtopics.net/J~E3PaAA0q9kPG12u1ueiw)**   
  Enable term frequency--inverse document frequency (TF-IDF) to increase the search result scores of search terms that appear more frequently in a document, but less frequently in the whole collection of searchable documents.
* **[Set the relative weight of a field](https://servicenow-prod.fluidtopics.net/ThhUKK061xSSEWpzXC_ufQ)**   
  To improve search results, the Zing search engine assigns to each potential match a numeric score that represents its relevancy to the query.

**Related concepts**   

* [Available search options](https://servicenow-prod.fluidtopics.net/YXLvLR59kI_DRCWicLOVWw "Zing offers users several search interfaces and search operators to conduct text searches.")
* [Global search finds records from multiple tables](https://servicenow-prod.fluidtopics.net/2bOiNrNnOg~tzsnBhO0tfg "Search multiple record types from a single search field.")
* [Zing generates search results in four phases](https://servicenow-prod.fluidtopics.net/I4v9owTFQI69LAd1QCDt6Q "Generate search results by dividing documents among shards, searching shard documents, scoring shard documents, and merging scores into an index.")
* [Zing filters search results with access controls](https://servicenow-prod.fluidtopics.net/ClO4ivYixkQWnXafYN3MuA "Zing filters search results to only display records the user can access.")
* [Zing indexes words](https://servicenow-prod.fluidtopics.net/AB8NyACY6I7vgRVk1I020g "Index documents by dividing them into words. Depending on the languages your instance supports, a word may be a single character such as a Chinese or Japanese pictogram or a sequence of characters separated by spaces such as with Latin, Arabic, and Pinyin languages.")
* [Zing can include attachments in search results](https://servicenow-prod.fluidtopics.net/HKHetJGR~OH_SaAsHKC7cw "Search content from attachments on indexed tables. Display attachments for search results from the Knowledge [kb_knowledge] table.")
* [Zing removes stop words from queries](https://servicenow-prod.fluidtopics.net/bW0xB8UoGIAvpHhwGVq1hA "Remove common words from search queries that don't produce meaningful results.")
* [Zing matches derived words with stemming](https://servicenow-prod.fluidtopics.net/LYNgNn~YvuiOkiw6arsNjQ "Convert any multiple-character search keyword to its stem form to find derived versions of the word.")
* [Zing can expand search results with synonyms](https://servicenow-prod.fluidtopics.net/IHMRIcjmC28_0vLgAJvnmA "Expand search results to include additional search terms.")
* [Zing displays search suggestions as users enter search terms](https://servicenow-prod.fluidtopics.net/qsQ4UBV2fIiEZnoAIS4aTw "Display possible search query completions as users enter search terms.")  
**Related reference**   

* [Features of Zing text indexing and search engine](https://servicenow-prod.fluidtopics.net/5tAYuwDuw~mJ502TnRGtew "Enable and configure Zing text indexing and search engine features.")
* [Installed with Zing](https://servicenow-prod.fluidtopics.net/AKxk5xTJr8QS7GonvtkqKw "Several types of components are installed with Zing.")

