Skip to content

Conversation

@gerlowskija
Copy link
Contributor

https://issues.apache.org/jira/browse/SOLR-12224

Description

Solr allows users to create collectionproperties with its /admin/collections?action=COLLECTIONPROP API, but doesn't offer any API-based way to read these properties. Users are forced to use SolrJ's ZkStateReader to lookup the collection-properties, or connect to Zookeeper in some other way to read them.

Solution

This PR introduces two new v2 endpoints that give users an API-centric way of reading these properties: GET /api/collections/someCollName/properties to list all properties of a collection, and GET /api/collections/someCollName/properties/somePropName to fetch specific properties by name.

These new v2 APIs are implemented via JAX-RS, and appear in Solr's OpenAPI, meaning that they're now included in our SolrJ generation. SolrJ users can call these APIs with the SolrRequest classes CollectionPropertiesApi.ListCollectionProperties and CollectionPropertiesApi.GetCollectionProperty.

Tests

Added coverage for new "read" APIs in CollectionsAPISolrJTest, using the generated SolrRequest classes.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended, not available for branches on forks living under an organisation)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide
  • I have added a changelog entry for my change

API is available at: `GET /api/collections/collName/properties`
API available at: `GET /api/collections/collName/properties/propName`
@github-actions github-actions bot added documentation Improvements or additions to documentation tests cat:cloud cat:api labels Jan 22, 2026
@gerlowskija gerlowskija changed the title Solr 12224 add collprop read apis SOLR-12224: Add APIs to read collection properties Jan 22, 2026
Copy link
Contributor

@epugh epugh left a comment

Choose a reason for hiding this comment

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

I did a quick skim and it looks good. Also just a nice PR to read, and maybe model other adding of APIs on!

Copy link
Contributor

@HoustonPutman HoustonPutman left a comment

Choose a reason for hiding this comment

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

Perfect PR. No notes

@HoustonPutman
Copy link
Contributor

Might be good to have an API to update more than one value at once, but it doesn't have to be done here.

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

Labels

cat:api cat:cloud documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants