Skip to content

Add external IDs in search API results - #191

Open
jmsevin wants to merge 6 commits into
mainfrom
conversation-pixel
Open

Add external IDs in search API results#191
jmsevin wants to merge 6 commits into
mainfrom
conversation-pixel

Conversation

@jmsevin

@jmsevin jmsevin commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces enhancements to how document external IDs are handled and returned throughout the backend, especially in the search service. It adds support for fetching and including external_id fields for documents in search results, updates database queries and models accordingly, and improves test coverage for these changes. There are also minor code style and refactoring improvements.

Document external ID support:

  • Added document_external_id field to the DocumentPayloadModel and ensured it's populated in payloads returned from get_documents_payload_by_ids_sync. [1] [2]
  • Implemented a new function get_external_ids_by_document_ids_sync to efficiently fetch external IDs for a list of document IDs.
  • Updated the search service to enrich search results with document_external_id by calling the new function and updating the payload for each result. [1] [2] [3] [4]

Testing improvements:

  • Updated and extended tests to cover cases where documents have or lack an external_id, ensuring the new field is handled correctly. [1] [2]

Build and code quality improvements:

  • Refactored the Makefile to introduce a generate-baml target and ensure code generation is run before development, test, and poetry commands.
  • Minor code style and formatting improvements in tests and async function definitions. [1] [2] [3]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant