Open
Conversation
Co-authored-by: metaodi <[email protected]>
Copilot
AI
changed the title
[WIP] Implement SRU 2.0 with backward compatibility support
Add SRU 2.0 support (backwards compatible)
Feb 26, 2026
Owner
Co-authored-by: metaodi <[email protected]>
Contributor
Author
The differences page wasn't reachable from this environment, but based on the SRU 2.0 specification the relevant differences for a client library are:
If there's a specific item from that page I missed, happy to address it. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
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.
SRU 2.0 uses different XML namespaces than SRU 1.x for response, explain, and diagnostics elements. The library had no awareness of these namespaces, causing SRU 2.0 server responses to fail parsing entirely.
Changes
xmlparse.py: Register SRU 2.0 namespaces (sruResponse,sruExplain) in bothnamespacesanddict_namespaces, mapping them to the existing"sru"key so all downstream XPath queries work without modification.response.py: Refactored_check_response_tagto detect SRU 2.0 root namespaces and hot-swapxmlparser.namespaces["sru"]accordingly, making version detection transparent to all response parsing logic.client.py: Extended_check_errorsto also probe the SRU 2.0 diagnostics namespace (http://docs.oasis-open.org/ns/search-ws/diagnostic). Added asort_keysparameter tosearchretrieve()that maps to thesortKeysURL parameter for SRU 1.x requests; the parameter is silently omitted for SRU 2.0, where sorting is done via the CQLsortbyclause in the query.__init__.py: Exposedsort_keysas a passthrough parameter in the module-levelsearchretrieve()function.README.md: Updated to advertise SRU 1.1, 1.2, and 2.0 support.Usage
SRU 1.1 and 1.2 behavior is unchanged.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.