Skip to content

SOLR-17625 NamedList.findRecursive-> _get #3355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,8 @@ public void testExprMetrics() throws Exception {
key1),
resp);
// response structure is like in the case of non-key params
NamedList<Object> entries2 = resp.getValues();
Object val =
entries2._get(
Object val =
resp.getValues()._get(
List.of("metrics", "solr.core.collection1", "QUERY./select.requestTimes"), null);
assertNotNull(val);
assertTrue(val instanceof MapWriter);
Expand All @@ -657,8 +656,7 @@ public void testExprMetrics() throws Exception {
key2),
resp);
// response structure is like in the case of non-key params
NamedList<Object> entries1 = resp.getValues();
val = entries1._get(List.of("metrics", "solr.core.collection1"), null);
val = resp.getValues()._get(List.of("metrics", "solr.core.collection1"), null);
assertNotNull(val);
Object v = ((SimpleOrderedMap<Object>) val).get("QUERY./select.requestTimes");
assertNotNull(v);
Expand Down Expand Up @@ -692,8 +690,7 @@ public void testExprMetrics() throws Exception {
MetricsHandler.EXPR_PARAM,
key3),
resp);
NamedList<Object> entries = resp.getValues();
val = entries._get(List.of("metrics", "solr.core.collection1"), null);
val = resp.getValues()._get(List.of("metrics", "solr.core.collection1"), null);
assertNotNull(val);
// for requestTimes only the full set of values from the first expr should be present
assertNotNull(val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,11 @@ public void testClassicFacets() throws Exception { // AKA SimpleFacets
+ FIELD);
final QueryResponse response = query(params);
assertEquals(6, getHmObj(response).get("gridLevel")); // same test as above
NamedList<Object> entries1 = response.getResponse();
assertEquals(
2, entries1._get(List.of("facet_counts", "facet_heatmaps", "course", "gridLevel"), null));
NamedList<Object> entries = response.getResponse();
assertTrue(
assertEquals(
2, response.getResponse()._get(List.of("facet_counts", "facet_heatmaps", "course", "gridLevel"), null));
assertTrue(
((NamedList<Object>)
entries._get(List.of("facet_counts", "facet_heatmaps", "course"), null))
response.getResponse()._get(List.of("facet_counts", "facet_heatmaps", "course"), null))
.indexOf("counts_" + courseFormat, 0)
>= 0);
}
Expand Down Expand Up @@ -438,8 +436,7 @@ public void testJsonFacets() throws Exception {
+ " } "
+ "}"));
{
NamedList<Object> entries1 = response.getResponse();
final NamedList<?> q1Res = (NamedList<?>) entries1._get(List.of("facets", "q1"), null);
final NamedList<?> q1Res = (NamedList<?>) response.getResponse()._get(List.of("facets", "q1"), null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remember "gw tidy", I see here and elsewhere. I think you can configure IntelliJ better so that basic indentation like this would not be incorrect so often. I have an idea that I'll raise elsewhere that should reduce this annoyance.

assertEquals("1", q1Res.get("count").toString());
NamedList<Object> entries = response.getResponse();
final NamedList<?> q2Res = (NamedList<?>) entries._get(List.of("facets", "q2"), null);
Expand Down Expand Up @@ -502,15 +499,13 @@ public void testJsonFacets() throws Exception {

private NamedList<?> getHmObj(QueryResponse response) {
// classic faceting
NamedList<Object> entries1 = response.getResponse();
final NamedList<?> classicResp =
(NamedList<?>) entries1._get(List.of("facet_counts", "facet_heatmaps", FIELD), null);
final NamedList<?> classicResp =
(NamedList<?>) response.getResponse()._get(List.of("facet_counts", "facet_heatmaps", FIELD), null);
if (classicResp != null) {
return classicResp;
}
// JSON Facet
NamedList<Object> entries = response.getResponse();
return (NamedList<?>) entries._get(List.of("facets", "f1"), null);
return (NamedList<?>) response.getResponse()._get(List.of("facets", "f1"), null);
}

@Test
Expand Down
Loading