lucene-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guna Sekhar Dora (Jira)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-13806) SolrJ QueryResponse._explainMap is incorrectly typed
Date Sun, 01 Dec 2019 08:22:00 GMT

    [ https://issues.apache.org/jira/browse/SOLR-13806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16985497#comment-16985497
] 

Guna Sekhar Dora commented on SOLR-13806:
-----------------------------------------

[~ab] Added a draft PR at [https://github.com/apache/lucene-solr/pull/1048] for now. I
will have to check if this can be unit tested. 

> SolrJ QueryResponse._explainMap is incorrectly typed
> ----------------------------------------------------
>
>                 Key: SOLR-13806
>                 URL: https://issues.apache.org/jira/browse/SOLR-13806
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>    Affects Versions: 8.3
>            Reporter: Andrzej Bialecki
>            Priority: Major
>              Labels: newdev
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> This field, and the corresponding getter, and the code that extracts debug information
from the NamedList response in {{extractDebugInfo}}, all use a {{Map<String, String>}}
type.
> However, when {{debug.explain.structured=true}} is used the values returned in response
are not String-s, instead they are {{SimpleOrderedMap}}-s. This causes the following exception
to be thrown:
> {code}
> java.lang.ClassCastException: class org.apache.solr.common.util.SimpleOrderedMap cannot
be cast to class java.lang.String (org.apache.solr.common.util.SimpleOrderedMap is in unnamed
module of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')
> 	at __randomizedtesting.SeedInfo.seed([1D6FB4036A639051:173F5FF19E860E6F]:0)
> 	at org.apache.solr.client.solrj.response.QueryResponse.extractDebugInfo(QueryResponse.java:246)
> 	at org.apache.solr.client.solrj.response.QueryResponse.setResponse(QueryResponse.java:143)
> 	at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:207)
> 	at org.apache.solr.client.solrj.SolrClient.query(SolrClient.java:987)
> ...
> {code}
> The simple fix is to change the type of this field to {{Map<String, Object>}} but
this would change the public API of {{QueryResponse.getExplainMap()}} in incompatible way.
Still, I would argue it's worth to change it - AFAIK this getter is not used anywhere in the
Solr's codebase, and the change makes it more consistent with other getters.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Mime
View raw message