2

Is there a way in Solr to perform bulk updates without specifying it document by document?

In Solr we can update a field of a single record at a time, But in order to update the 1000 record it's gonna take more time . So any option is there to update a field of thousand indexes in a shot or in a one go ?

2
  • 2
    This one liner statement does not give any idea...could you be more descriptive? Commented Dec 29, 2016 at 6:12
  • 1
    In Solr we can update a field of a single record at a time, But in order to update the 1000 record it's gonna take more time . So any option is there to update a field of thousand indexes in a shot or in a one go ?
    – Theodore
    Commented Dec 29, 2016 at 7:18

2 Answers 2

8

No, there is nothing similar to UPDATE foo SET field = "bar" - you'll have to either submit the complete set of updated documents, or a batches of atomic update commands (each related to a separate id).

[{"id":"mydoc", "price":{"set":99}}, 
 {"id":"mydoc2", "price":{"set":199}}]
1
  • Thnaks for the reply !
    – Theodore
    Commented Jan 2, 2017 at 15:08
0

If you have a set of documents already serialized as newline-delimited JSON, you can use a tool like solrbulk to index them quickly into SOLR or solrcloud.

$ solrbulk -server https://localhost:8085/coll1 file.ndj

Disclaimer: I'm one of the authors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.