使用solrj作为客户端从Solr删除索引 [英] Deleting index from Solr using solrj as a client

查看:218
本文介绍了使用solrj作为客户端从Solr删除索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用solrj作为客户端来索引solr服务器上的文档.

I am using solrj as client for indexing documents on the solr server.

在从solr服务器上通过'id'删除索引时遇到问题. 我正在使用以下代码删除索引:

I am having problem while deleting the indexes by 'id' from the solr server. I am using following code to delete the indexes:

server.deleteById("id:20");
server.commit(true,true);

此后,当我再次搜索文档时,搜索结果中也包含上述文档.不知道此代码出了什么问题. 请帮我解决问题.

After this when i again search for the documents, the search result contains the above document also. Dont know what is going wrong with this code. Please help me out with issue.

谢谢!

推荐答案

调用deleteById时,只需使用id,无需查询语法:

When you call deleteById, just use the id, without query syntax:

server.deleteById("20");
server.commit();

这篇关于使用solrj作为客户端从Solr删除索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆