Created on 11-21-2016 09:37 PM
Special thanks to Michael Young for the help to be my mentor.
Step1:
cd /opt/lucidworks-hdpsearch/solr/server/solr/configsets/data_driven_schema_configs/conf/
screen-shot-2016-11-21-at-100524-am.png
Step2:
vi managed-schema: add these 3 lines
<field name="_timestamp_" type="date" indexed="true" stored="true" multiValued="false" />
<field name="_ttl_" type="string" indexed="true" multiValued="false" stored="true" />
<field name="_expire_at_" type="date" multiValued="false" indexed="true" stored="true" />
screen-shot-2016-11-21-at-100929-am.png
Step3:
vi solrconfig.xml on the same directory.
Replace the below 3 lines with the lines after it:
<updateRequestProcessorChain name="add-unknown-fields-to-the-schema">
<!-- UUIDUpdateProcessorFactory will generate an id if none is present in the incoming document -->
<processor />
as
<processor>
<str name="fieldName">_timestamp_</str>
</processor>
<str name="fieldName">_ttl_</str>
<str name="value">+30SECONDS</str>
<processor class="solr.processor.DocExpirationUpdateProcessorFactory">
<str name="ttlFieldName">_ttl_</str>
<str name="ttlParamName">_ttl_</str>
<int name="autoDeletePeriodSeconds">30</int>
<str name="expirationFieldName">_expire_at_</str>
<str name="fieldName">_expire_at_</str>
<processor class="solr.UUIDUpdateProcessorFactory" />
screen-shot-2016-11-21-at-101045-am.png
Hope that helps.
Thanks,
Sujitha