[
https://issues.apache.org/jira/browse/SOLR-17684?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Umut Saribiyik resolved SOLR-17684.
-----------------------------------
Resolution: Fixed
> 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
> Components: SolrJ
> Affects Versions: 9.8
> Reporter: Umut Saribiyik
> Priority: Minor
> Labels: guide, monitor, pingrequest, pull-request-available,
> reference, solrj
> Attachments: image-2025-02-26-13-29-31-289.png
>
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> 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().
>
>
> *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]