'Search Docker containers on quay.io.
Results are displayed with all available versions,
including the complete image name.'

def search_repository(self, search_string, non_strict):

    with self.index.searcher() as searcher:
        search_string = ('*%s*' % search_string)
        query = QueryParser('title', self.index.schema).parse(search_string)
        results = searcher.search(query)
        if non_strict:
            corrector = searcher.corrector('title')
            suggestions = corrector.suggest(search_string, limit=2)
            for suggestion in suggestions:
                search_string = ('*%s*' % suggestion)
                query = QueryParser('title', self.index.schema).parse(search_string)
                results_tmp = searcher.search(query)
                results.extend(results_tmp)
        sys.stdout.write(('The    query    \x1b[1m    %s    \x1b[0m    resulted    in    %s    result(s).\n' % (search_string, len(results))))
        if non_strict:
            sys.stdout.write('The    search    was    relaxed    and    the    following    search    terms    were    searched:    ')
            sys.stdout.write(('\x1b[1m    %s    \x1b[0m\n' % ',    '.join(suggestions)))
        out = list()
        for result in results:
            title = result['title']
            for version in self.get_additional_repository_information(title):
                row = [title]
                row.append(version)
                out.append(row)
        if out:
            col_width = (max((len(word) for row in out for word in row)) + 2)
            for row in out:
                name = row[0]
                version = row[1]
                sys.stdout.write((''.join((word.ljust(col_width) for word in row)) + ('docker    pull    quay.io/%s/%s:%s\n' % (self.organization, name, version))))
        else:
            sys.stdout.write(('No    results    found    for    %s    in    quay.io/%s.\n' % (search_string, self.organization)))
