Upsert a Document and Search the Data Source
A 3-step recipe with Dust. We can help you get access.
Recipe · 3 steps
Upsert a Document and Search the Data Source
with Dust
Upsert a document, wait for indexing, and search the data source.
- Upsert the document into the data source synchronously so it is queued for indexing.
- Check how many upsert workflows are still running for this data source. Continue polling while any are running, otherwise proceed to search.
- Run a semantic search against the data source to confirm the upserted document is retrievable.
What you'll need to have ready
- apiToken: Dust API key used as the Bearer token.
- wId: The workspace identifier.
- spaceId: The space identifier containing the data source.
- dsId: The data source identifier.
- documentId: The document identifier to upsert.
- title: Title of the document.
- text: Plain text content of the document.
- query: The search query to run after indexing.
- topK: Number of search results to return (defaults to 5).
For your developer
Arazzo workflow dust-tt:upsert-document-and-search, 3 operations: {$sourceDescriptions.datasourcesApi.url}#/paths/~1api~1v1~1w~1{wId}~1spaces~1{spaceId}~1data_sources~1{dsId}~1documents~1{documentId}/post → {$sourceDescriptions.datasourcesApi.url}#/paths/~1api~1v1~1w~1{wId}~1spaces~1{spaceId}~1data_sources~1{dsId}~1check_upsert_queue/get → {$sourceDescriptions.datasourcesApi.url}#/paths/~1api~1v1~1w~1{wId}~1spaces~1{spaceId}~1data_sources~1{dsId}~1search/get. Specs on APIs.io.