完全删除 solr 3.5.0 索引

deleting solr 3.5.0 index completely

我在 solr 中创建了多个索引:test1, test2,test3...

现在我想做的是 完全 删除它们

以下将删除索引 test1 中的数据,但不会删除索引本身,因为 index 仍在 solr admin 中显示。 (灵感来自 here

curl http://index.websolr.com/solr/test1/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'

我希望通过手动删除目录并重新启动 solr 来避免弄脏我的手(从而可能避免损坏 solr)。

还有吗?

你可以试试这个

http://localhost:8983/solr/admin/cores?action=UNLOAD&core=test1

UNLOAD 操作从 Solr 中删除一个核心。

所以根据你的要求你可以试试

http://localhost:8983/solr/admin/cores?action=UNLOAD&core=test1&deleteIndex=true&deleteDataDir=true

此处的 deleteDataDir 是您要查找的内容 - 如果 deleteDataDir 为真,则删除数据目录和所有子目录。

http://localhost:8983/solr/admin/cores?action=UNLOAD&core=test1&deleteInstanceDir=true

对于其他参数,请检查以下 link。

UNLOAD Solr Core