Jan Høydahl created SOLR-18452:
----------------------------------
Summary: Use Content-Type header to distinguish single JSON
document from JSON command object
Key: SOLR-18452
URL: https://issues.apache.org/jira/browse/SOLR-18452
Project: Solr
Issue Type: Improvement
Components: update
Reporter: Jan Høydahl
Assignee: Jan Høydahl
Today the /update/json handler will support docs in an array or a single JSON
object.
If a single object is passed, it is ambigous whether to interpret it as a plain
JSON document with fields, or to interpret it as Solr's special command JSON
with "add", "delete" etc commands as JSON keys. Solr uses the request parameter
json.command to distringuish whether the single JSON doc is a command or a
document, see SOLR-6294.
This is confusing and non standard.
Instead, Solr should use the standard HTTP header "Content-Type" to know how to
interpret the body:
* {{application/json}} will mean plain solr document
* {{application/vnd.solr.commands+json}} will mean a command object
There will be two sub tasks for this Jira
# Deprecate the request parameter, and declare that from 11.0 users must use
the header (10.x)
# Remove request-param, introduce the header parsing logic as a replacement.
(11.0)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]