Zing computes document scores using three components

  • Release version: Yokohama
  • Updated January 30, 2025
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Zing computes document scores using three components

    The Zing search engine calculates document relevance scores for search queries by evaluating three main components: frequency of search terms, sequence of terms, and the weight of the fields where terms appear. This scoring approach helps ServiceNow customers optimize search results for better accuracy and relevance.

    Show full answer Show less

    Key Features

    • Frequency Points: Zing awards one point for each occurrence of a search term in a document. For example, if the terms "distributed," "database," and "server" appear multiple times, their total counts contribute to the frequency score.
    • TF-IDF Enhancement: By enabling term frequency–inverse document frequency (TF-IDF), Zing increases the impact of terms that appear frequently in a specific document but less frequently across the entire document set. This helps highlight more relevant, less common terms.
    • Sequence Points: Zing assigns exponentially higher scores when search terms appear in the exact order as in the query. The scoring formula is 10 raised to the number of sequential terms, multiplied by the field weight. For instance, a three-term exact phrase scores 10³ (1000) points per occurrence.
    • Field Scoring Weights: Each field has an associated tsweight attribute that multiplies the frequency and sequence scores. Critical fields like Knowledge record numbers and task numbers have higher default weights (e.g., 50), enhancing their influence on the total score. Most other fields have a default weight of 1, with a maximum possible weight of 255.

    Practical Impact for ServiceNow Customers

    • Understanding how Zing scores documents enables customers to fine-tune search configurations, such as enabling TF-IDF or adjusting field weights, to improve search relevancy.
    • Higher weighted fields ensure that key identifiers and descriptions meaningfully impact search rankings, making it easier for users to find the most relevant records quickly.
    • Sequence scoring rewards exact phrase matches, encouraging precise query formulation and delivering more accurate search results.
    • Overall, these scoring components work together to provide a balanced, relevance-driven search experience across ServiceNow tables and records.

    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.
    Figure 1. Sample document score computation
    Graphic showing frequency and sequence scoring for sample search query and document.

    Frequency points

    Zing awards one point whenever a search term appears anywhere in the document. For example, when searching for distributed database server, 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). 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 distributed database server, 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 distributed database server search example, Zing awards a document 100 (10^2) sequence points for each time it includes the two-term string database server. Likewise, Zing awards a document 1000 (10^3) sequence points each time it includes the three-term string distributed database server.

    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

    All other fields have a default ts_weight attribute of 1. The maximum possible weight value is 255.