简体   繁体   English

Solr-发布时的未知字段名称

[英]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.

相关问题 Solr:当子项和父项具有在搜索条件中使用的相同字段名称时如何检索父文档 - Solr : How to retrieve Parent Doc when Both child and parent having the same field name which is used in the search criteria Apache Solr 在不指定字段名的情况下在整个集合中搜索一个字符串 - Apache Solr search a string in the entire collection without specifying the field name org.apache.solr.common.SolrException:未定义的字段名称 - org.apache.solr.common.SolrException: undefined field name 索引未知字段时强制字符串类型 - Force string type when indexing unknown field 得到? 在提醒ajax响应或将其发布到文本字段时 - Getting ? when alerting the ajax response or posting it to a text field 类名称为字符串时强制转换为未知类型 - Casting to Unknown Type When Class Name as a String “字段列表”中的未知列“userentity0_.last_name” - Unknown column 'userentity0_.last_name' in 'field list' 我被这个错误所震惊(MySQLSyntaxErrorException:“字段列表”中的未知列“名称”) - I'm struck with this error (MySQLSyntaxErrorException: Unknown column 'name' in 'field list') 字段类型未知时,对访问字段秘密的反射改进 - Reflection improvements to access field secret, when field type is unknown Spring & Hibernate:“字段列表”中的未知列,但列名匹配 - Spring & Hibernate: Unknown Column in 'field list' but column name is matching
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM