epotyom commented on code in PR #16868:
URL: https://github.com/apache/lucene/pull/16868#discussion_r4324116518
##########
lucene/sandbox/src/test/org/apache/lucene/sandbox/facet/TestRangeFacet.java:
##########
@@ -1142,6 +1143,37 @@ public void testByNameNoSkipIndexEquivalence() throws
Exception {
IOUtils.close(dir);
}
+ public void testByNameNoSkipIndexMixedSegmentsEquivalence() throws Exception
{
+ Directory dir = newDirectory();
+ IndexWriterConfig iwc = newIndexWriterConfig();
+ iwc.setMergePolicy(NoMergePolicy.INSTANCE);
+ RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
+ w.setDoRandomForceMerge(false);
+
+ // A multi-valued segment followed by a single-valued one, so the by-name
cutter picks a
+ // different leaf cutter for each.
+ int numDocs = atLeast(500);
+ for (int i = 0; i < numDocs; i++) {
+ Document doc = new Document();
+ doc.add(new SortedNumericDocValuesField("field",
TestUtil.nextLong(random(), -100, 100)));
+ if (i == 0 || random().nextBoolean()) {
+ doc.add(new SortedNumericDocValuesField("field",
TestUtil.nextLong(random(), -100, 100)));
+ }
+ w.addDocument(doc);
+ }
+ w.commit();
+ for (int i = 0; i < numDocs; i++) {
+ Document doc = new Document();
+ doc.add(new SortedNumericDocValuesField("field",
TestUtil.nextLong(random(), -100, 100)));
+ w.addDocument(doc);
+ }
+
+ assertSkipIndexEquivalence(w, "by-name-no-skip-index-mixed-segments");
Review Comment:
IIUC we don't have skip index here, so we are testing if getting field by
name and reading field values directly produce same results, correct? In this
case, maybe we can rename `assertSkipIndexEquivalence` to make it more clear,
wdyt?
--
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]