如何通过curl查询删除SOLR索引的数据? [英] How to delete SOLR indexed data by query with curl?

查看:427
本文介绍了如何通过curl查询删除SOLR索引的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个像这样的SOLR schema.xml:

I have a SOLR schema.xml like this:

<field name="cartype" type="lowercase" indexed="true" stored="true"/>
<field name="color" type="lowercase" indexed="true" stored="true"/>

我想使用curl命令从SOLR数据库中删除blue和stationwagon标记的记录。

I want to delete "blue" and "stationwagon" tagged records from SOLR database with a curl command.

但是我没有这样做:

curl http://46.231.77.98:7979/solr/update/?commit=true -H "Content-Type: text/xml" -d "<delete>(cartype:stationwagon)AND(color:blue)</delete>"

你有什么建议吗?

推荐答案

您必须添加查询标签。

<delete><query>(cartype:stationwagon)AND(color:blue)</query></delete>

这篇关于如何通过curl查询删除SOLR索引的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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