1

I am trying to update the value of existing field in solr document to a new value using curl.Below is the query and response. But I do not see the value for code getting reflected in solr. Please help to resolve the issue.

curl  -X POST -H 'Content-Type: application/json' 'http://localhost:8390/solr/collection/update' -d '[{"id" : “12345”,”code” : {"set" : “500”}}]’
{
  "responseHeader":{
    "rf":1,
    "status":0,
    "QTime":11}}
Eli Johnes
  • 301
  • 3
  • 13

1 Answers1

2

Looks like you have missed the commit=true in your request and hence the issue.

Try the below command and hopefully it should work for you.

curl  -X POST -H 'Content-Type: application/json' 'http://localhost:8390/solr/collection/update?commit=true' -d '[{"id" : “12345”,”code” : {"set" : “500”}}]’
{
  "responseHeader":{
    "rf":1,
    "status":0,
    "QTime":11}}
Abhijit Bashetti
  • 8,518
  • 7
  • 35
  • 47
  • 1
    Thanks Abhijit. Commit was the issue. – Eli Johnes Jan 30 '23 at 10:22
  • I am facing one more issue here. The updated record has other fields like name,place etc..If I search with name in the query parameter (q), record is not showing up.But if I include name as fq parameter, I am able to see the record. Can you please help me on this. – Eli Johnes Jan 31 '23 at 06:40
  • It would be helpful if you create another question with more details like what are exact fields with some dummy data. ANd what is the query been fired – Abhijit Bashetti Jan 31 '23 at 08:17