0
votes

I am using Solr 6.6. I am trying atomic updates on a date field. The field is defined in schema as

field name="inventory_update_time" type="date" indexed="true" stored="true" omitNorms="true" multiValued="false" omitTermFreqAndPositions="true"/

and I am firing the curl request as curl 'localhost:8081/solr/sitename/update' -H 'Content-type:application/json' -d '[{"id":"9988062","inventoryUpdateTime":"2018-07-03T06:29:29Z"}]'

but the date is not getting updated.

any suggestions?

1

1 Answers

0
votes

Your field name and your JSON name is not the same. You're not doing atomic updates either, since that would require a "set" command.

Your schema has the field name set as inventory_update_time, but in your JSON structure you're using inventoryUpdateTime as the key.

To actually perform an atomic update:

[
  {
    "id":"9988062",
    "inventory_update_time":{
      "set":"2018-07-03T06:29:29Z"
    }
  }
]