diff --git a/src/phoenix_technologies/smd/server.py b/src/phoenix_technologies/smd/server.py index c5bc19d..025a144 100644 --- a/src/phoenix_technologies/smd/server.py +++ b/src/phoenix_technologies/smd/server.py @@ -107,8 +107,14 @@ async def smd_research(search_query: str = "Bundesrat", date_from: str = "2024-0 { "field": "datetime", "value": [ - date_from, - date_to + os.getenv('SWISSDOX_DATEFROM', '2020-12-31T23:00:00.000Z'), + os.getenv('SWISSDOX_DATETO', '2023-12-31T22:59:00.000Z') + ] + }, + { + "field": "newspaper", + "value": [ + os.getenv('SWISSDOX_NEWSPAPER', 'NZZ') ] }, { @@ -134,6 +140,7 @@ async def smd_research(search_query: str = "Bundesrat", date_from: str = "2024-0 result = response.json() articles = result.get("data", []) + facets = result.get("facets", []) tasks = [] for article in articles: @@ -142,7 +149,8 @@ async def smd_research(search_query: str = "Bundesrat", date_from: str = "2024-0 tasks.append(smd_detail_article(article_id)) detailed_articles = await asyncio.gather(*tasks) return { - "original_result": result, + "related_persons": facets.get("persons", []), + "related_organizations": facets.get("persons", []), "detailed_articles": detailed_articles } else: