2017-09-27 51 views
0
使用

curl可以做到:(更新價格字段值100)更新Solr的文檔使用HTTP GET方法

curl http://localhost:8983/solr/update?commit=true' -H 'Content-type:application/json' -d '[{"id":"1","price":{"set":100}}] 

如何使用HTTP GET方法一樣嗎?我需要填寫下面的XXXX:

http://localhost:8983/solr/mycore/update?stream.body=XXXX&commit=true 

下不起作用:

http://localhost:8983/solr/mycore/update?stream.body=<add><doc><field name="id">1</field><field name="price" update="set">100</field></doc></add>&commit=true 

回答

1

的stream.body並不需要是XML,所以此工程:

http://localhost:8983/solr/mycore/update?stream.body=[{"id":"1","price":{"set":100}}]&commit=true