Repository navigation
[Ready] SOLR-10424: The sample no longer sets mapUniqueKeyOnly for /update/json/docs, so each posted field is indexed under its own name - #5159
Draft
nick-boss-tech wants to merge 7 commits into
Conversation
…for /update/json/docs Hypothetical, unrun regression test; see SOLR-10424-TESTING.md.
nick-boss-tech
marked this pull request as ready for review
October 16, 2026 06:48
mapUniqueKeyOnly for /update/json/docs, so each posted field is indexed under its own namemapUniqueKeyOnly for /update/json/docs, so each posted field is indexed under its own name
nick-boss-tech
marked this pull request as draft
October 28, 2026 04:45
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.
🤖 AI text below 🤖 (posted on behalf of Nick Shanin)
Ready for review, but held as a draft due to the project's open-PR cap; I'll mark it open on request.
https://issues.apache.org/jira/browse/SOLR-10424
What happens today
Posting JSON documents to
/update/json/docson the techproducts example stores only the id and the_src_copy.Before this change, the sample's
params.jsonsetmapUniqueKeyOnlyto true in the_UPDATE_JSON_DOCSset (params.json at the base). The/update/json/docshandler reads that set (implicit handler at the base). The sample's defaultdfistext(solrconfig at the base). So the other values go intotextwith no field name. That field is indexed but not stored (schema at the base), so no field is indexed under its own name.What this change does
The sample no longer sets
mapUniqueKeyOnlyfor/update/json/docs, so each posted field is indexed under its own name.The
srcFieldsetting stays, so the_src_copy is still stored. A copy of the oldparams.jsonkeeps the old behavior.A field that the sample schema does not define now fails the request. The sample schema has no catch-all field: the
*dynamic field is commented out (schema), and the sample solrconfig has no chain that adds unknown fields. Before this change, those values were copied intotextwithout their names.A post with no
idstill gets a generated one. Thejson-docs-uuidchain, which the sample's/update/json/docspath selects, adds a UUID whenidis missing, as the reference guide describes. The V2 update endpoints,/api/collections/<name>/updateand/api/collections/<name>/update/json, select the same chain, so they generate one too (UpdateAPI).A choice to check
The sample no longer has the id-only default.
The options are:
Option 1 costs a new error for any post with a field the sample schema lacks. Option 2 keeps the behavior this ticket reports as unusable.
Was removing the default the right call for the example, or should the id-only mode stay as the default?
Limits
Some cases are untested, and the order of this change and SOLR-8240 matters.
SolrExampleTests.testArbitraryJsonIndexingposts a document with noid. Commitb0a03a5226eaddsnamequeries to it; the class passed at that commit (42 tests, 0 failures, 1 skipped), and with only the sample solrconfig reverted to the base version the test fails, because the posted document gets no generated id without thejson-docs-uuidchain.mapUniqueKeyOnlytreatsf. Until this default is gone, requests to the sample that sendffail under that change, so this change should land before, or together with, SOLR-8240.Changelog:
changelog/unreleased/SOLR-10424-techproducts-json-docs.ymlProof
TechproductsJsonDocsParamsTest passed 1 of 1 at
b0a03a5226e. The test fails on the base code.TechproductsJsonDocsParamsTest.testUpdateJsonDocsParamSetDoesNotDropFields(test) reads the sampleparams.json. It checks that the_UPDATE_JSON_DOCSset keepssrcFieldand has nomapUniqueKeyOnly.cabedd1d968), with only this test file added, the test fails once, on themapUniqueKeyOnlycheck.b0a03a5226e: TechproductsJsonDocsParamsTest 1 of 1, and SolrExampleJsonTest 42 tests with 0 failures and 1 skipped. The params test reads the file. It does not post a document.5f38ba54a8, counted from fresh JUnit XML (seed10424C0FFEE10424). At5b087b1a389the same test fails: the V2 post to/api/collections/tp/update/jsonreturns HTTP 400,Document is missing mandatory uniqueKey field: id. The/update/json/docspost passes at both commits.5b087b1a389only retitles the changelog fragment; the retitled fragment parses, and no code changed between it andb0a03a5226e. Commit5f38ba54a8adds the V2 update chain inUpdateAPIand the V2 test below.AI assistance
AI agents assisted with research, implementation, review, and drafting. Nick Shanin directed the work and takes responsibility for this contribution.