Search code examples
solrsolr6

Solr default field value refresh on atomic update


I have a date field with default value NOW in my Solr schema:

<field name="ActionTimestamp"
       type="date" indexed="true"
       stored="true"
       default="NOW"
       multiValued="false"/>

Is there any way to refresh the ActionTimestamp value automatically on every atomic update? So I need it to be updated with NOW value on every atomic update. Now I have to set this field explicitly in the code.

Solr version is 6.4.2.


Solution

  • with Atomic Updates you only change the fields you need. If you are changing other fields other than AtomicTimestamp, it is as designed that this field does not get updated.

    If you absolutely want the value to be set automatically, just reindex the whole doc (no Atomic Update), and NOW value will be used.

    Or, do as you are doing now, and set the time on the value yourself.