adityamparikh commented on issue #182:
URL: https://github.com/apache/solr-mcp/issues/182#issuecomment-5357688420
This is already fixed by #175, which predates this issue by two weeks — I
filed this without
finding that PR.
#175's analysis matches this one: the empty facet `[]` falls through
`isFlatNamedList`'s zero-length rejection to the plain-list branch, and
SolrJ's
`QueryResponse.getFacetFields()` casts to `NamedList`. It fixes it by
threading the node path
through the traversal and treating anything directly under
`facet_counts/facet_fields` as a
NamedList regardless of shape.
Two corrections to what I wrote above, both from reading the code afterwards:
- **`json.nl=map` is not a viable fix.** `ResponseParser` exposes no hook
for query params and
the client builder has no default-params method, so it would mean wrapping
every request — and
`json.nl` is global, silently collapsing the duplicate keys a `NamedList`
permits.
- **Allowing `size == 0` in the heuristic is also wrong**, which #175 gets
right. An empty
`"collections": []` must stay a `List` because
`CollectionService.listCollections()` casts it
to `List<String>`, so that change would just relocate the
`ClassCastException` to
`list-collections` against an empty cluster.
Suggest closing this as a duplicate when #175 merges.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]