You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is most noticeable with bulk requests because of the bulk format. Since the newline is used as a separator, omitting a newline will index a document that contains two JSON objects. The first JSON object is indexed properly, while the second is completely ignored (not found in the mapping, etc).
However, this causes problems with source retrieval, search, GET, etc because the JSON is invalid.
There should either be an error returned when trying to index a document containing two (or more) discrete objects, or the non-indexed objects should be removed from the source. The exception seems preferable so the user knows something went wrong.
Closing this, resolved by #11414. If you attempt to index a "double" JSON object, ES throws an exception up-front now instead of silently accepting it:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Malformed action/metadata line [3], expected START_OBJECT or END_OBJECT but found [VALUE_NUMBER]"
}
],
"type": "illegal_argument_exception",
"reason": "Malformed action/metadata line [3], expected START_OBJECT or END_OBJECT but found [VALUE_NUMBER]"
},
"status": 400
}
This is most noticeable with bulk requests because of the bulk format. Since the newline is used as a separator, omitting a newline will index a document that contains two JSON objects. The first JSON object is indexed properly, while the second is completely ignored (not found in the mapping, etc).
However, this causes problems with source retrieval, search, GET, etc because the JSON is invalid.
There should either be an error returned when trying to index a document containing two (or more) discrete objects, or the non-indexed objects should be removed from the source. The exception seems preferable so the user knows something went wrong.
Reproduction (Bulk):
Reproduction (Single Doc):
The text was updated successfully, but these errors were encountered: