[
https://issues.apache.org/jira/browse/SOLR-18452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jan Høydahl updated SOLR-18452:
-------------------------------
Description:
*⚠️ NOTE: I may want to re-scope this into removing the JSON command syntax
altogether, it blocks Solr approaching strict JSON parsing for all its input.*
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 are two sub tasks for this Jira, one deprecation to land in 10.x and the
removal/switch to land in 11.0
was:
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 are two sub tasks for this Jira, one deprecation to land in 10.x and the
removal/switch to land in 11.0
> 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
> Priority: Major
>
> *⚠️ NOTE: I may want to re-scope this into removing the JSON command syntax
> altogether, it blocks Solr approaching strict JSON parsing for all its input.*
> 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 are two sub tasks for this Jira, one deprecation to land in 10.x and
> the removal/switch to land in 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]