CROSSLINK-234 Add full text search#489
Merged
JanisSaldabols merged 9 commits intomainfrom Mar 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds full-text search support for patron requests by persisting searchable content in the DB and exposing new CQL fields for filtering/listing.
Changes:
- Add
items(JSONB) andlanguage(regconfig) topatron_request, plus asearchtsvector with a GIN index and triggers to keep it updated. - Extend CQL filtering to support
title,patron, andcql.serverChoicebacked by thesearchcolumn. - Expose patron-request
itemsin the API response model and update tests/OpenAPI/docs accordingly.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| broker/migrations/021_add_items_to_pr.up.sql | Adds items, search, language, triggers, index, and recreates patron_request_search_view. |
| broker/migrations/021_add_items_to_pr.down.sql | Rollback for migration 021 (drops triggers/index/columns/view). |
| broker/patron_request/db/prmodels.go | Introduces PrItem model and custom JSON time parsing for items JSONB. |
| broker/sqlc/sqlc.yaml | Overrides sqlc mapping to decode items JSONB into []PrItem. |
| broker/sqlc/pr_schema.sql | Updates sqlc schema with new items and language columns. |
| broker/sqlc/pr_query.sql | Includes language/items in list query; adds language to create/update queries. |
| broker/patron_request/db/prcql.go | Adds CQL fields title, patron, and cql.serverChoice (tsvector). |
| broker/patron_request/db/prrepo.go | Maps newly selected Language and Items onto PatronRequest results. |
| broker/patron_request/api/api-handler.go | Includes items in PatronRequest API responses; sets Language on creation. |
| broker/patron_request/service/message-handler.go | Ensures Language is persisted during request creation and updates. |
| broker/patron_request/service/action.go | Ensures Language is preserved when updating patron requests. |
| broker/patron_request/service/action_test.go | Updates mock repo behavior to account for new params fields. |
| broker/oapi/open-api.yaml | Documents items on PatronRequest and new CQL filter fields. |
| broker/README.md | Documents LANGUAGE env var used for tsvector/CQL search language. |
| broker/test/patron_request/api/api-handler_test.go | Adds coverage for cql.serverChoice and updates CRUD query expectations. |
| broker/test/patron_request/db/prrepo_test.go | Updates DB tests to set Language on created records. |
jakub-id
reviewed
Mar 26, 2026
jakub-id
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.