Zing computes document scores using three components

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 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

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.

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.

Following the example above, each time the string "database server" appears in a document, it is awarded 100 (10^2) sequence points. Likewise, each time the string "distributed database server" appears in a document, it is awarded 1000 (10^3) sequence points.

Zing awards sequence points as 10^x, where x is the number of search terms that appear in sequence. If the sequence appears in a field that is weighted, Zing applies a multiplier to the sequence points based on the value of the ts_weight attribute for the field. The sequence points use the calculation (10^x * weight of the field).

Weight points

Zing awards a document more points if the field in which it appears is weighted. Zing applies a multiplier to frequency points based on the value of the ts_weight attribute for the field.

By default, each field has a weight of 1. A field with a weight of 50 (ts_weight=50) would add 50 points each time a search term appeared in the field. The maximum possible weight value is 255.

By default, the system elevates the scoring weight of knowledge record numbers, knowledge short descriptions, task record numbers, and task short descriptions.
  • kb_knowledge.number = 50
  • kb_knowledge.short_description = 10
  • kb_knowledge.meta = 10
  • task.number = 50
  • task.short_description = 10