fetch_news
Fetch News
Type:
fetch_news
• Category:flow
• Tags:news
,data
,mongo
Description
Fetch news documents (key=news) from dataexchange
Parameters
Name | Type | Description | Required | Default |
---|---|---|---|---|
query | string | Search text (hybrid: title/body/vector) | no | |
dateFrom | date | Start ISO datetime (inclusive) | no | |
dateTo | date | End ISO datetime (inclusive) | no | |
limit | number | Max docs (1-100) | no | 100 |
sortMode | string | Sorting: relevance (text match), date_desc (newest first), date_asc (oldest first) | no | "relevance" |
Help
Overview
The News Fetcher worker retrieves documents that are stored under the news
key in the data‑exchange system. It supports full‑text, title, and vector‑based searches, allows you to restrict results by date range, limit the number of returned items, and choose how the results are sorted.
Input Parameters
query
– string – The text to search for. The search is hybrid, meaning it looks at the document title, body, and vector embeddings.dateFrom
– date – ISO‑8601 formatted start of the time window (inclusive). Only documents created on or after this timestamp are considered.dateTo
– date – ISO‑8601 formatted end of the time window (inclusive). Only documents created on or before this timestamp are considered.limit
– number – Maximum number of documents to return. Must be between 1 and 100. Default is 100.sortMode
– string – Determines the ordering of the results. Accepted values are:"relevance"
– order by how well the document matches the query (default)"date_desc"
– newest documents first"date_asc"
– oldest documents first
Minimal Example
{
"query": "climate change",
"dateFrom": "2024-01-01T00:00:00Z",
"dateTo": "2024-06-30T23:59:59Z",
"limit": 25,
"sortMode": "date_desc"
}
The example above asks the worker to return up to 25 news items that contain the phrase “climate change” in either the title, body, or vector representation, limited to the first half of 2024, and sorted with the most recent articles first.