'Produces a portion of the search query from the current SQ and its
children.'

def as_query_string(self, query_fragment_callback):

    result = []
    for child in self.children:
        if hasattr(child, u'as_query_string'):
            result.append(child.as_query_string(query_fragment_callback))
        else:
            (expression, value) = child
            (field, filter_type) = self.split_expression(expression)
            result.append(query_fragment_callback(field, filter_type, value))
    conn = (u'    %s    ' % self.connector)
    query_string = conn.join(result)
    if query_string:
        if self.negated:
            query_string = (u'NOT    (%s)' % query_string)
        elif (len(self.children) != 1):
            query_string = (u'(%s)' % query_string)
    return query_string
