def organisations()

in src/plugins/brokers/kibbleES.py [0:0]


    def organisations(self):
        """ Return a list of all organisations """
        orgs = []
        
        # Run the search, fetch all orgs, 9999 max. TODO: Scroll???
        res = self.DB.search(
            index=self.config['elasticsearch']['database'],
            doc_type="organisation",
            size = 9999,
            body = {
                'query': {
                    'match_all': {}
                }
            }
        )
    
        for hit in res['hits']['hits']:
            org = hit['_source']['id']
            orgClass = KibbleOrganisation(self, org)
            yield orgClass