Umut Saribiyik created SOLR-17684:
-------------------------------------
Summary: Issue in SolrJ Reference Guide (Ping) - Incorrect Status
Retrieval
Key: SOLR-17684
URL: https://issues.apache.org/jira/browse/SOLR-17684
Project: Solr
Issue Type: Bug
Security Level: Public (Default Security Level. Issues are Public)
Components: SolrJ
Affects Versions: 9.8
Reporter: Umut Saribiyik
Attachments: image-2025-02-26-13-29-31-289.png
The SolrJ Reference Guide provides incorrect examples for retrieving the ping
status of a collection.
[https://solr.apache.org/guide/solr/9_8/deployment-guide/ping.html]
*Issues:*
# pingResponse.getStatus() returns the status of the ping request itself
(status=0), not the collection's ping status ("OK").
# Since getResponse() returns a NamedList<Object>, the value must be
explicitly cast to a String or converted using .toString().
!https://issues.apache.org/jira/secure/temporaryattachment/23480fd2e619aa45020d288e20db821fb7ea279f/temp8845089792067389041_image-2025-02-26-13-29-31-289.png|width=536,height=235!
*Correction:*
The correct way to retrieve the collection's ping status:
{code:java}
String status = (String) process.getResponse().get("status");
String status = process.getResponse().get("status").toString();
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]