Skip to content

feat(cn-browse): Don't index instance ids for call numbers#919

Draft
viacheslavkol wants to merge 2 commits intomasterfrom
MSEARCH-1187
Draft

feat(cn-browse): Don't index instance ids for call numbers#919
viacheslavkol wants to merge 2 commits intomasterfrom
MSEARCH-1187

Conversation

@viacheslavkol
Copy link
Contributor

@viacheslavkol viacheslavkol commented Mar 20, 2026

Purpose

Don't index instance ids for call numbers
Same call number could be used in 20k, 40k and even 100k instances in production.
This results in retrieval of big aggreagates from postgres and then indexing all of it in elasticsearch.
However those ids aren’t really needed for anything. In case of multiple ids - we just return count in browse and in case of one id - we retrieve instance title by it.
Proposed approach will reduce memory pressure on mod-search, save space on elasticsearch and improve indexing and searching performance of call numbers

Approach

  • instead of aggregating all instance ids for call number from postgres - just count them and add instance id only if count=1
  • Add count to call number index
  • Update browse service and search response post processor

Changes Checklist

  • API Changes: Document any API paths, methods, request or response bodies changed, added, or removed.
  • Database Schema Changes: Indicate any database schema changes and their impact. Confirm that migration scripts were created.
  • Interface Version Changes: Indicate any changes to interface versions.
  • Interface Dependencies: Document added or removed dependencies.
  • Permissions: Document any changes to permissions.
  • Logging: Confirm that logging is appropriately handled.
  • Unit Testing: Confirm that changed classes were covered by unit tests.
  • Integration Testing: Confirm that changed logic was covered by integration tests.
  • Manual Testing: Confirm that changes were tested on local or dev environment.
  • NEWS: Confirm that the NEWS file is updated with relevant information about the changes made in this pull request.

Related Issues

MSEARCH-1187

- instead of aggregating all instance ids for call number from postgres - just count them and add instance id only if count=1
- Add count to call number index
- Update browse service and search response post processor

Implements: MSEARCH-1187
@viacheslavkol viacheslavkol self-assigned this Mar 20, 2026
@sonarqubecloud
Copy link

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant