epugh commented on PR #5096:
URL: https://github.com/apache/solr/pull/5096#issuecomment-7365537795

   ### Manual test steps (techproducts)
   
   Steps to check the change by hand against the techproducts example. I ran 
them against `8f000b959a0` and got the results shown below.
   
   **1. Build and start**
   
   ```bash
   ./gradlew dev
   solr/packaging/build/dev/bin/solr start -e techproducts
   ```
   
   **2. Register the processors.** techproducts has no date-parsing or 
blank-removal processor, so add them with the Config API and select them with 
`processor=`.
   
   ```bash
   curl -X POST -H 'Content-type:application/json' 
http://localhost:8983/solr/techproducts/config -d '{
     "add-updateprocessor": {"name": "parsedate", "class": 
"solr.ParseDateFieldUpdateProcessorFactory", "format": ["MM/dd/yyyy"]}
   }'
   curl -X POST -H 'Content-type:application/json' 
http://localhost:8983/solr/techproducts/config -d '{
     "add-updateprocessor": {"name": "removeblank", "class": 
"solr.RemoveBlankFieldUpdateProcessorFactory"}
   }'
   ```
   
   **3. Regular update** (unchanged behavior)
   
   ```bash
   curl -X POST -H 'Content-type:application/json' \
     
'http://localhost:8983/solr/techproducts/update?processor=parsedate&commit=true'
 -d '[
     {"id": "urp-test", "name": "URP test", "release_dt": "12/25/2025", 
"dates_dts": ["01/01/2026"], "tags_ss": ["a", "b"]}
   ]'
   curl 
'http://localhost:8983/solr/techproducts/select?q=id:urp-test&fl=id,release_dt,dates_dts,tags_ss'
   ```
   
   Result: `release_dt: 2025-12-25T00:00:00Z`, `dates_dts: 
[2026-01-01T00:00:00Z]`, `tags_ss: [a, b]`.
   
   **4. Atomic update** (the fix)
   
   ```bash
   curl -X POST -H 'Content-type:application/json' \
     
'http://localhost:8983/solr/techproducts/update?processor=parsedate&commit=true'
 -d '[
     {"id": "urp-test", "release_dt": {"set": "07/04/2026"}, "dates_dts": 
{"add": "02/14/2026"}}
   ]'
   curl 
'http://localhost:8983/solr/techproducts/select?q=id:urp-test&fl=id,release_dt,dates_dts'
   ```
   
   Result: `release_dt: 2026-07-04T00:00:00Z`, `dates_dts: 
[2026-01-01T00:00:00Z, 2026-02-14T00:00:00Z]`. Without this PR, the processor 
skips the atomic values and the update fails with a date-parse error.
   
   **5. Clearing a field with `set` and a blank value**
   
   ```bash
   curl -X POST -H 'Content-type:application/json' \
     
'http://localhost:8983/solr/techproducts/update?processor=removeblank&commit=true'
 -d '[
     {"id": "urp-test", "tags_ss": {"set": ""}}
   ]'
   curl 
'http://localhost:8983/solr/techproducts/select?q=id:urp-test&fl=id,tags_ss,release_dt'
   ```
   
   Result: `tags_ss` is removed and `release_dt` is untouched. Before 
`8f000b959a0`, the `set` was silently dropped and `tags_ss` kept `[a, b]`.
   
   **6. Clean up**
   
   ```bash
   curl -X POST -H 'Content-type:application/json' 
http://localhost:8983/solr/techproducts/config -d '{"delete-updateprocessor": 
"parsedate"}'
   curl -X POST -H 'Content-type:application/json' 
http://localhost:8983/solr/techproducts/config -d '{"delete-updateprocessor": 
"removeblank"}'
   ```
   


-- 
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]

Reply via email to