【发布时间】:2013-02-27 23:53:24
【问题描述】:
我正在运行 Solr4.1。 我确实有一个 version 字段,但我不明白如何通过查询删除时间。我的架构中没有任何字段具有我可以看到的时间戳。
我要做的是运行一个查询,删除所有早于 30 天的文档。
我已经尝试了所有可以在网上找到的东西。
curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>_version_:[* TO NOW-60DAYS] </query></delete>'
curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>timestamp:[* TO NOW-60DAYS] </query></delete>'
curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>createTime:[* TO NOW-60DAYS] </query></delete>'
其他删除工作正常,例如
curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>field:value</query></delete>'
【问题讨论】:
标签: solr