diff --git a/odds/backend/scanner/worldbank/worldbank_catalog_scanner.py b/odds/backend/scanner/worldbank/worldbank_catalog_scanner.py index c83432a..16b3049 100644 --- a/odds/backend/scanner/worldbank/worldbank_catalog_scanner.py +++ b/odds/backend/scanner/worldbank/worldbank_catalog_scanner.py @@ -83,6 +83,7 @@ async def scan(self) -> AsyncIterator[Dataset]: description='\n'.join(filter(None, [identification.get('title'), identification.get('subtitle'), identification.get('description')])), publisher=identification.get('citation'), publisher_description='', - resources=resources + resources=resources, + link=f'https://datacatalog.worldbank.org/search/dataset/{dataset_unique_id}' ) yield dataset diff --git a/odds/common/qa_repo/es/es_qa_repo.py b/odds/common/qa_repo/es/es_qa_repo.py index f40b99c..fcb72bb 100644 --- a/odds/common/qa_repo/es/es_qa_repo.py +++ b/odds/common/qa_repo/es/es_qa_repo.py @@ -67,7 +67,10 @@ async def storeQA(self, question: str, answer: str, success: bool, score: int, d deployment_id=deployment_id, embeddings=(await embedder.embed(question)).tolist() ) - await client.create(index=ES_INDEX, id=id, body=body) + try: + await client.create(index=ES_INDEX, id=id, body=body) + except elasticsearch.ConflictError: + await client.update(index=ES_INDEX, id=id, body={'doc': body}) return self.toQa(body) async def getQuestion(self, *, question: str=None, id: str=None, deployment_id: str=None) -> Optional[QA]: