2
使用Solr 6.0.0,我按照this walkthrough來配置集合中文檔的自動失效。Solr集合中文檔的自動失效
我的默認solrconfig.xml中僅具有除(按照初排建議)
<!-- auto delete collection --> <updateRequestProcessorChain default="true"> <processor class="solr.TimestampUpdateProcessorFactory"> <str name="fieldName">timestamp_dt</str> </processor> <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.FirstFieldValueUpdateProcessorFactory"> <str name="fieldName">expire_at_dt</str> </processor> <processor class="solr.LogUpdateProcessorFactory" /> <processor class="solr.RunUpdateProcessorFactory" />
我創建的集合與上述結構;
bin/solr create -c tweets -d tweets_configs -s 1 -rf 1
插入文檔
date -u && curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/tweets/update?commit=true' -d '[{"id":"live_forever"},{"id":"live_2_minutes_a", "time_to_live_s":"+120SECONDS"}]'
和
date -u && curl -X POST -H 'Content-Type: application/json' 'http://localhost:8983/solr/tweets/update?commit=true&_ttl_=%2B5MINUTES' -d '[{"id":"live_a_long_time", "expire_at_dt":"3000-01-01T00:00:00Z" }, {"id":"live_2_minutes_b", "time_to_live_s":"+120SECONDS"}, {"id":"use_default_ttl"}]'
但是,當我查詢的文件,也沒有過期設置應該已經有按演練;
{ "responseHeader":{ "zkConnected":true, "status":0, "QTime":19, "params":{ "q":"*:*", "indent":"on", "wt":"json"}}, "response":{"numFound":5,"start":0,"docs":[ { "id":"live_forever", "_version_":1533920832055672832}, { "id":"live_2_minutes_a", "time_to_live_s":"+120SECONDS", "_version_":1533920832086081536}, { "id":"live_a_long_time", "expire_at_dt":"3000-01-01T00:00:00Z", "_version_":1533921242796523520}, { "id":"live_2_minutes_b", "time_to_live_s":"+120SECONDS", "_version_":1533921242825883648}, { "id":"use_default_ttl", "_version_":1533921242829029376}] }}
而我期待看到期滿自動設置爲每在步驟1中配置的多個機制。
它在6.0.0中的工作方式與4.8不同嗎?還是我錯過了明顯的東西?