mirror of https://github.com/apache/lucene.git
SOLR-9740: fix macro expansion of multi-valued parameters
This commit is contained in:
parent
da841be887
commit
11840469d9
|
@ -136,6 +136,11 @@ Bug Fixes
|
||||||
of matching something due to filter exclusions (which can widen the domain again).
|
of matching something due to filter exclusions (which can widen the domain again).
|
||||||
(Michael Sun, yonik)
|
(Michael Sun, yonik)
|
||||||
|
|
||||||
|
* SOLR-9740: A bug in macro expansion of multi-valued parameters caused non-expanded values
|
||||||
|
after the first expanded value in the same multi-valued parameter to be dropped.
|
||||||
|
(Erik Hatcher, yonik)
|
||||||
|
|
||||||
|
|
||||||
Other Changes
|
Other Changes
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,8 @@ public class MacroExpander {
|
||||||
newValues.add(vv);
|
newValues.add(vv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (newValues != null) {
|
||||||
newValues.add(newV);
|
newValues.add(newV);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,4 +113,17 @@ public class TestMacroExpander extends LuceneTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testMap() { // see SOLR-9740, the second fq param was being dropped.
|
||||||
|
final Map<String,String[]> request = new HashMap<>();
|
||||||
|
request.put("fq", new String[] {"zero", "${one_ref}", "two", "${three_ref}"});
|
||||||
|
request.put("one_ref",new String[] {"one"});
|
||||||
|
request.put("three_ref",new String[] {"three"});
|
||||||
|
Map expanded = MacroExpander.expand(request);
|
||||||
|
assertEquals("zero", ((String[])expanded.get("fq"))[0]);
|
||||||
|
assertEquals("one", ((String[])expanded.get("fq"))[1]);
|
||||||
|
assertEquals("two", ((String[]) expanded.get("fq"))[2]);
|
||||||
|
assertEquals("three", ((String[]) expanded.get("fq"))[3]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue