Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update the data in solr

Tags:

solr

solr4

Trying to updating the solr document with below passed data

[{"id":"6","status":{"set":"3"}},
{"id":"10","status":{"set":"3"}}]

Throwing this error message :

"msg": "Expected: OBJECT_START but got ARRAY_START at [16]",

Please suggest a best way to update solr 4.0 document data with single url.

like image 617
Gautam3164 Avatar asked Oct 30 '22 18:10

Gautam3164


1 Answers

Quoting from lucene discussion page: Reference Link

The admin page accepts only a single JSON document to be added, because it wraps it in tags like so...

{"add":{ "doc": YOUR_TEXT_AREA_INPUT, ....

You can use the curl utility or post.jar for adding multiple document at the same time.

Reference for the updating solr document using curl . Updating a Solr Index with JSON

like image 146
YoungHobbit Avatar answered Nov 15 '22 10:11

YoungHobbit