adityamparikh opened a new pull request, #271: URL: https://github.com/apache/solr-mcp/pull/271
Closes #183. ## What `create-collection` defaulted `configSet` to `_default` and passed it as `collection.configName`, which binds the collection to that configset **by reference**. `_default` runs in schemaless mode, so the first collection's guessed field types were written into the shared managed-schema, and every later collection inherited them. Field types can't be changed, so `add-fields` failed with `Field 'title' already exists` on a collection that had never been indexed. | `configSet` | Request | Configset the collection gets | |---|---|---| | omitted, blank, or `_default` | `createCollection(name, numShards, rf)`, no `collection.configName` | a private copy that Solr makes, named `<name>.AUTOCREATED` and deleted with the collection | | any other name | `createCollection(name, configSet, numShards, rf)`, as before | that configset, shared by reference | The cleanup is Solr's own behaviour (`DeleteCollectionCmd`), so the server has no cleanup code of its own. An explicit configset is not copied: on Solr 9, `ConfigSetAdminRequest.Create` from a trusted base returns 401 without authentication. The tool and `configSet` descriptions now say that naming a configset shares it, so `add-fields` changes apply to every collection using it. `CollectionCreationResult` gains `configSet`, so the caller can see which configset the collection uses. The record is already registered in `SolrNativeHints`. ## Docs - `setup-collection` prompt and the README tools row describe the private-copy default. - `docs/tutorial.md` drops "Step 3 — Reset" (the instruction to restart Solr between collections) and the matching known-issue entry. The later steps are renumbered, and Step 3 now notes that `shows` does not inherit the guesses made in `shows-auto`. ## Tests - `CollectionServiceTest` captures the `SolrRequest`. Omitted, `_default` and blank `configSet` send no `collection.configName` and report `<name>.AUTOCREATED`. A named configset is sent and reported as given. - `CollectionServiceIntegrationTest` replays the issue's repro. It creates `leak183_a`, indexes a schemaless document into it, then creates `leak183_b`. `leak183_b` has none of the guessed fields, `add-fields` succeeds on it, CLUSTERSTATUS reports both `.AUTOCREATED` configsets, and deleting `leak183_a` removes its copy. With the old binding put back, this test fails with `Guessed field leaked: [..., leak183_platform, leak183_rating]`. - The shows-schema step in `McpClientIntegrationTestBase` keeps adding only the missing fields: other test classes still bind collections to `_default` directly through SolrJ, and a new copy inherits what they wrote. Only its comment changes. `./gradlew build` passes: 471 tests, 0 skipped. `CollectionServiceIntegrationTest` also passes with `-Dsolr.test.image=solr:9.4-slim` and `solr:10-slim`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
