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

查看:20
本文介绍了如何通过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.

但我没有使用以下命令执行此操作:

But I didn't do that with following 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>"

您有什么建议吗?

推荐答案

你必须添加query标签.

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

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

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