Boolean expression

Hyperspace allows Boolean operations between conditions, using the python operators and, or , not.

Example

def score_function(params, doc):
   score = 0.0
   if match("field 1") and 
      ((match("field2") and not match("field3"))
       or window_match("field4", “2d”,“1d"):):
      score = 1.0
   return score 

Last updated