我想出来的Solr ......试图删除查询时,我得到了以下错误:Solr的delete语句错误
curl http://localhost:8983/solr/update --data-binary '<delete><id>SP2514N</id></delete>'
的错误是:
Error 400 missing content stream
Problem accessing /solr/update. Reason: missing content stream
我想出来的Solr ......试图删除查询时,我得到了以下错误:Solr的delete语句错误
curl http://localhost:8983/solr/update --data-binary '<delete><id>SP2514N</id></delete>'
的错误是:
Error 400 missing content stream
Problem accessing /solr/update. Reason: missing content stream
其他答案似乎是正确的,但没有解释原因。 您只需将您正在使用的内容类型更改为text/xml
,否则卷曲使用默认application/x-www-form-urlencoded
和--data-binary
选项(或-d
)。
你应该使用下面的命令:
curl -H 'Content-Type: text/xml' http://localhost:8983/solr/update --data-binary '<delete><id>SP2514N</id></delete>'
您可能希望将commit=true
参数添加到URL,立即发出承诺,否则你仍然会看到你想删除的文件(直到下一次提交)。
您也可以使用参数stream.body
参数,在URL via GET内直接传递xml,如其他答案中的建议。
用途: -
http://localhost:8983/solr/update?stream.body=<delete><query>id:SP2514N</query></delete>&commit=true