'Search a particular content in the scripts results.'

@staticmethod
def searchscript(name=None, output=None, values=None):

    req = {}
    if (name is not None):
        req['id'] = name
    if (output is not None):
        req['output'] = output
    if (values is not None):
        if (name is None):
            raise TypeError('.searchscript()    needs    a    `name`    arg    when    using    a    `values`    arg')
        for (field, value) in viewitems(values):
            req[('%s.%s' % (xmlnmap.ALIASES_TABLE_ELEMS.get(name, name), field))] = value
    if (not req):
        return {'ports.scripts': {'$exists': True}}
    if (len(req) == 1):
        (field, value) = next(iter(viewitems(req)))
        return {('ports.scripts.%s' % field): value}
    return {'ports.scripts': {'$elemMatch': req}}
