'Search plugin API method'

def search(self, task, entry, config=None):

    session = Session()
    entries = set()
    if isinstance(config, bool):
        tag_names = None
    else:
        tag_names = config
    try:
        for query in entry.get(u'search_strings', [entry[u'title']]):
            query = re.sub(u'[    \\(\\)]+', u'    ', query).strip()
            log.debug((u'looking    for    `%s`    config:    %s' % (query, config)))
            for archive_entry in search(session, query, tags=tag_names, desc=True):
                log.debug((u'rewrite    search    result:    %s' % archive_entry))
                entry = Entry()
                entry.update_using_map(self.entry_map, archive_entry, ignore_none=True)
                if entry.isvalid():
                    entries.add(entry)
    finally:
        session.close()
    log.debug((u'found    %i    entries' % len(entries)))
    return entries
