Hello,

We are trying to add documents in solr with ttl defined(document expiration
feature), which is expected to expire at specified time, but it is not.

Following are the settings we have defined in solrconfig.xml and
managed-schema.

solr version : 5.0.0
*solrconfig.xml*
-----------------------
    <updateRequestProcessorChain default="true">
    <processor class="solr.processor.DocExpirationUpdateProcessorFactory">
      <int name="autoDeletePeriodSeconds">30</int>
      <str name="ttlFieldName">time_to_live_s</str>
      <str name="expirationFieldName">expire_at_dt</str>
    </processor>
    <processor class="solr.LogUpdateProcessorFactory" />
    <processor class="solr.RunUpdateProcessorFactory" />
  </updateRequestProcessorChain>

*managed-schema*
-----------------------
    <field name="id" type="string" indexed="true" stored="true"
multiValued="false" />
    <field name="time_to_live_s" type="string" stored="true"
multiValued="false" />
    <field name="expire_at_dt" type="date" stored="true"
multiValued="false" />

*solr query*
--------------------
Following query posts a document and sets "expire_at_dt" explicitly. That
is working perfectly ok and ducument expires at defined time.

curl -X POST -H 'Content-Type: application/json' '
http://localhost:8983/solr/collection1/update?commit=true' -d '[{
"id":"10seconds","expire_at_dt":"NOW+10SECONDS"}]'


But when trying to post with TTL (following query), document does not
expire after given time.

curl -X POST -H 'Content-Type: application/json' '
http://localhost:8983/solr/collection1/update?commit=true' -d '[{
"id":"10seconds","time_to_live_s":"+10SECONDS"}]'

Any help would be appreciated.

Thanks,
Makailol

Reply via email to