Arithmetic Operators

Hyperspace allows arithmetic operations between scores, using the operators +, *, -, / . These operators can be used in combination with the operator =.

Example

def score_function(params, doc):
   score0 = 0.0
   if match("field 1"):
      score0 += rarity_max("field2")
      score0 -= rarity_sum("field3")
   score1 = 2 * score0
   return score1

Where-

score0 is the result of a score function.

Last updated