: Few collections have the column : *solr_created_dttm* which is indexed. I : want to delete all the documents from these collections which are older : than 6 months. : : I understand there is *DocExpirationUpdateProcessorFactory *which needs to : be added to solrconfig.xml. : : Can someone please help with the configuration I need to add. I tried a
If you alread yhave an existing collection, containing existing documents, then adding DocExpirationUpdateProcessorFactory at this point will not help you delete documents where the "created" date field is more then 6months old. What the DocExpirationUpdateProcessorFactory does is provide 2 features that can be used together or independently: 1) add an *additional* "expirationField" at indexing time, containing an absolute datetime computed from some relative "TTL" (Time To Live) that can be specified per document (either as a field or as a request param when indexing) 2) provide a periodic timer to delete documents whose expirationField is in the past. So, hypothetically, you could DocExpirationUpdateProcessorFactory to solrconfig.xml, along with a DefaultValueUpdateProcessorFactory that included a "+6MONTH" TTL field in every document, and then re-index all of your documents and DocExpirationUpdateProcessorFactory could then start periodically deleting all docs based on this new expire field. Or ... you could just setup a small cron job to periodically run a DeleteByQuery request against your solr_created_dttm using similar -- but negated -- date math against your existing field... <delete><query>solr_created_dttm:[* TO NOW-6MONTH]</query></delete> -Hoss http://www.lucidworks.com/