Nested Objects

Hyperspace supports the use of nested objects through the standard Python dictionary syntax or using the "." token. Nested objects are stored as a sub-dictionary of the parent object, and can be accessed iteratively.

Example

def score_function(doc,params):
    score = 0.0
    if match('nested_object.field_1', 'field_1'):
        aggregate_count('....')
        for obj in doc["nested_object"]:
            score += obj["field_4"]
    return score

Where-

doc["nested_object"] is a nested list of dictionaries.

Last updated