[英]Solr - Unknown field name when posting
I'm trying to post a json to solr and keep getting this error...this is a custom field. 我正在尝试将json发布到solr并不断收到此错误...这是一个自定义字段。
Command being used: java -Dtype=application/json -jar post.jar convertcsv1.json 正在使用的命令:java -Dtype = application / json -jar post.jar convertcsv1.json
The "books.json" example shown here works fine: https://wiki.apache.org/solr/UpdateJSON 此处显示的“ books.json”示例可以正常工作: https ://wiki.apache.org/solr/UpdateJSON
Error back: 错误返回:
SimplePostTool version 1.5
Posting files to base url http://localhost:8983/solr/update using content-type application/json..
POSTing file convertcsv1.json
SimplePostTool: WARNING: Solr returned an error #400 Bad Request
SimplePostTool: WARNING: IOException while reading response: java.io.IOException: Server returned HTTP response code: 40
0 for URL: http://localhost:8983/solr/update
1 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/update..
If you do not add a required field to your post you get 400 Bad request error for missing required field. 如果您没有在帖子中添加必填字段,则会由于缺少必填字段而收到400错误的请求错误消息。 For an exact answer you should show logs of Solr under log folder at Solr home. 对于确切的答案,您应该在Solr主页的日志文件夹下显示Solr的日志。
If you want just post something on solr you can use a post plugin like Postman on chrome. 如果您只想在solr上发布内容,则可以在chrome上使用Postman之类的发布插件。
Postman Rest Client. 邮递员休息客户端。
You have to post on this url (use the commit=true param to commit the objects) 您必须在此url上发布(使用commit = true参数来提交对象)
http://localhost:8983/solr/update/json?commit=true
The content of your post have to be an array json. 您的帖子内容必须为数组json。
[
{..content..},
{..content2..}
]
Reference 参考
https://wiki.apache.org/solr/UpdateJSON https://wiki.apache.org/solr/UpdateJSON
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.