[ 
https://issues.apache.org/jira/browse/SOLR-17684?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Umut Saribiyik updated SOLR-17684:
----------------------------------
    Description: 
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}
 

 

 

  was:
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}
 

 

 


> 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
>            Priority: Minor
>              Labels: guide, monitor, pingrequest, reference, solrj
>         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().
>  
>  
> *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: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to