We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f716dcf commit 52c49c0Copy full SHA for 52c49c0
api/app/importing.py
@@ -19,13 +19,16 @@ async def get_articles(
19
"""
20
Fetch relevant articles from Diffbot KG endpoint
21
22
+ search_query = 'query=type%3AArticle+strict%3Alanguage%3A"en"+sortBy%3Adate'
23
+ if query:
24
+ search_query += f'+text%3A"{query}"'
25
+ if tag:
26
+ search_query += f'+tags.label%3A"{tag}"'
27
+
28
+ params = {"query": query, "size": size, "offset": offset}
29
30
try:
- search_query = 'query=type%3AArticle+strict%3Alanguage%3A"en"+sortBy%3Adate'
- if query:
- search_query += f'+text%3A"{query}"'
- if tag:
- search_query += f'+tags.label%3A"{tag}"'
- response = await client.search({query: query, size: size, offset: offset})
31
+ response = await client.search(params)
32
return response.entities
33
except Exception as ex:
34
raise ex
0 commit comments