Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/416#discussion_r211315461
--- Diff:
solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformerHierarchy.java
---
@@ -40,22 +43,52 @@
private static final Iterator<String> ingredientsCycler =
Iterables.cycle(ingredients).iterator();
private static final String[] names = {"Yaz", "Jazz", "Costa"};
private static final String[] fieldsToRemove = {"_nest_parent_",
"_nest_path_", "_root_"};
+ private static final int sumOfDocsPerNestedDocument = 8;
+ private static final int numberOfDocsPerNestedTest = 10;
+ private static boolean useSegments;
+ private static int randomDocTopId = 0;
+ private static String filterOtherSegments;
@BeforeClass
public static void beforeClass() throws Exception {
initCore("solrconfig-update-processor-chains.xml", "schema-nest.xml");
// use "nest" schema
+ useSegments = random().nextBoolean();
+ if(useSegments) {
+ final int numOfDocs = 10;
+ for(int i = 0; i < numOfDocs; ++i) {
+ updateJ(generateDocHierarchy(i), params("update.chain", "nested"));
+ if(random().nextBoolean()) {
+ assertU(commit());
+ }
+ }
+ assertU(commit());
+ randomDocTopId = counter.get();
+ filterOtherSegments = "{!frange l=" + randomDocTopId + "
incl=false}idInt";
+ } else {
+ filterOtherSegments = "*:*";
+ }
}
@After
public void after() throws Exception {
- clearIndex();
+ if (!useSegments) {
--- End diff --
You could keep this if you want (use BeforeClass but have delete query in
after()). But if you do, it could be simplified: Don't conditionally call
"clearIndex"; simply always do this delete. And there's a simpler overloaded
version -- `delQ(queryhere)`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]