Skip to content

[MDS-6921] Show tables and images in notice of work document search results#3933

Open
simensma-fresh wants to merge 28 commits into
developfrom
MDS_6921-NOW-table-extraction
Open

[MDS-6921] Show tables and images in notice of work document search results#3933
simensma-fresh wants to merge 28 commits into
developfrom
MDS_6921-NOW-table-extraction

Conversation

@simensma-fresh

@simensma-fresh simensma-fresh commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR adds artifact-first Notice of Work (NoW) document search results, focused on extracted figures, images, and tables.

At a high level:

  • The indexing pipeline now extracts tables, figures and images from NoW documents.
  • Search results in the NoW UI now render artifact previews and formatted table content directly in the result card, instead of relying only on raw text snippets.
  • An image of the artifact is pushed to S3 (through docman) to enable viewing of the artifact in search results
  • Some transformations happen, e.g. we attempt to rotate images / tables that are vertical based on hint given by document intelligence

What Changed

  • Permit service: Added backend pipeline support to extract artifact regions (tables/figures), attach page and bounding-box context, and include artifact metadata in indexed chunks.
  • Added artifact upload/registration flow so extracted preview images are stored and retrievable (docman)
  • Updated NoW search result rendering to show:
    • Artifact image preview near the top of each result card.
    • Expandable formatted table section for table artifacts.
    • Caption for the artifact if Document Intelligence finds one. If not, we fall back to an AI generated caption
  • AI generated description of the image / table gets indexed to enable images to show up in search results
  • Added in a rough categorization piece to identify whether images are maps, a site Photo or something else.

Why Document Manager

To keep it as the central place to manage files in S3, and have a record of the artifact in our DB.

Screenshots

image image image image

@simensma-fresh simensma-fresh changed the title DRAFT - Not ready for review - Mds 6921 now table extraction MDS-6921] Show tables and images in notice of work document search results Jun 10, 2026
@simensma-fresh simensma-fresh changed the title MDS-6921] Show tables and images in notice of work document search results [MDS-6921] Show tables and images in notice of work document search results Jun 10, 2026
asinn134
asinn134 previously approved these changes Jun 11, 2026

@asinn134 asinn134 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work Simen 👍

@alazar-aot alazar-aot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed a few small things, nothing major though so great work Simen, was cool to see how you went about implementing this!

Comment thread services/document-manager/backend/app/services/object_store_storage_service.py Outdated
Comment thread services/permits/app/pipelines/document_search/artifact_registration_client.py Outdated
Comment thread services/permits/app/pipelines/document_search/document_manager_client.py Outdated
Comment thread services/permits/app/pipelines/document_search/create_search_index.py Outdated
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_permits'

Failed conditions
77.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_common'

Failed conditions
31.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed for 'bcgov-sonarcloud_mds_minespace-web'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@alazar-aot alazar-aot self-requested a review June 16, 2026 18:10

@alazar-aot alazar-aot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - let's get this out there!!

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.

4 participants