如何使 SOLR 8.11.1 Ping api 调用返回 xml 而不是 json
我有一个可以访问 SOLR 4.10.2 实例上的核心的应用程序。我正在更新到 SOLR 8.11.1。
我的应用程序在4.10.2中调用ping api:结果以xml格式返回。当我在 SOLR 8.11.1 中进行相同的调用时,结果以 json 格式返回。
是否有一个设置(在 solrconfig.xml 中?或在 SOLR 核心...)将 8.11.1 中的默认结果类型设置为 xml?
I have an app that accesses cores on a SOLR 4.10.2 instance. I am updating to SOLR 8.11.1.
My app calls the ping api in 4.10.2: the results are returned in xml format. When I make the same call in SOLR 8.11.1, the results are returned in json format.
Is there a setting (in solrconfig.xml? or at a SOLR core ...) that will set the default result type to xml in 8.11.1?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
响应的格式由请求中的 wt 参数管理。在您的情况下,您只需调用
即可从 SOLR 8.11.1 Ref 获得 XML 响应
: solr 文档
The format of the response is managed by the
wt
parameter in the request. In your case you can simply calland you'll get an XML response also from SOLR 8.11.1
Ref: solr documentation
可以在核心的 solrconfig.xml 中配置默认的 queryResponseWriter。
我正在查看核心的 solrconfig.xml,有一个注释部分显示了如何将默认值设置为 xml:
我将其从注释中移出,重新加载核心,并且 ping 现在返回 xml。
The default queryResponseWriter can be configured in the solrconfig.xml for the core.
I was looking at the solrconfig.xml for the core, and there is a commented section that shows how to set the default as xml:
I moved it out of the comment, reloaded the core, and ping now returns xml.