'Helper function to generate a match-query
@param field: the Field
@param value: the value
@return: a Query'

def match(self, field, value):

    ftype = str(field.type)
    ignore_case = self.ignore_case
    if (ignore_case and hasattr(value, 'lower') and (ftype in ('string', 'text'))):
        query = (field.lower() == s3_unicode(value).lower().encode('utf-8'))
    else:
        query = (field == value)
    return query
