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