def search(query): config = Config.getInstance() client = config.getESClient() res = client.search(index="location_lookup", body={ "query": { "query_string": { "query": query } } }) for hit in res['hits']['hits']: return hit["_source"]
def __init__(self, app): print("2") LocationKafkaListerner.__instance = self self.app = app self.config = Config.getInstance() self.register_client = CachedSchemaRegistryClient( url=app.config['KAFKA_SCHEMA_REGISTRY_URL'] ) print("3") self.client = self.config.getESClient() threading.Thread(target=self.readJobsData).start() threading.Thread(target=self.readMappingsData).start() threading.Thread(target=self.readSubmissionsData).start()