You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Klostermeyer, Michael" <mk...@riskexchange.com> on 2012/07/05 20:54:52 UTC
Update JSON format post 3.1?
Is there any official documentation on the JSON format Solr 3.5 expects when adding/updating documents via /update/json? Most of the official documentation is 3.1, and I am of the understanding this changed in v3.2 (https://issues.apache.org/jira/browse/SOLR-2496). I believe I have the correct format, but I am getting an odd error:
"The request sent by the client was syntactically incorrect (Expected: OBJECT_START but got ARRAY_START"
My JSON format is as follows (simplified):
{"add":
{"doc":
[
{"ID":"987654321","Name":"Steve Smith","ChildIDs":["3841"]}
]
}
}
The idea is that I want to be able to send multiple documents within the same request, although in this example I am demonstrating only a single document. "ChildIDs" is defined as a multivalued field.
Thanks.
Mike Klostermeyer
RE: Update JSON format post 3.1?
Posted by "Klostermeyer, Michael" <mk...@riskexchange.com>.
Sorry...I found the answer in the comments of the previously mentioned Jira ticket. Apparently the proposed solution differed from the final one (the "doc" structure key is not needed, apparently).
Mike
-----Original Message-----
From: Klostermeyer, Michael [mailto:mklostermeyer@riskexchange.com]
Sent: Thursday, July 05, 2012 12:55 PM
To: solr-user@lucene.apache.org
Subject: Update JSON format post 3.1?
Is there any official documentation on the JSON format Solr 3.5 expects when adding/updating documents via /update/json? Most of the official documentation is 3.1, and I am of the understanding this changed in v3.2 (https://issues.apache.org/jira/browse/SOLR-2496). I believe I have the correct format, but I am getting an odd error:
"The request sent by the client was syntactically incorrect (Expected: OBJECT_START but got ARRAY_START"
My JSON format is as follows (simplified):
{"add":
{"doc":
[
{"ID":"987654321","Name":"Steve Smith","ChildIDs":["3841"]} ] } }
The idea is that I want to be able to send multiple documents within the same request, although in this example I am demonstrating only a single document. "ChildIDs" is defined as a multivalued field.
Thanks.
Mike Klostermeyer