'Create an index to quickly examine the repositories of a given quay.io organization.'

def build_index(self):

    parameters = {'public': 'true', 'namespace': self.organization}
    r = requests.get(QUAY_API_URL, headers={'Accept-encoding': 'gzip'}, params=parameters, timeout=12)
    tmp_dir = tempfile.mkdtemp()
    schema = Schema(title=TEXT(stored=True), content=STORED)
    self.index = create_in(tmp_dir, schema)
    json_decoder = json.JSONDecoder()
    decoded_request = json_decoder.decode(r.text)
    writer = self.index.writer()
    for repository in decoded_request['repositories']:
        writer.add_document(title=repository['name'], content=repository['description'])
    writer.commit()
