slow-J commented on code in PR #16868:
URL: https://github.com/apache/lucene/pull/16868#discussion_r4325775732
##########
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:
True, it reads the field directly and uses the skip index when there is one.
I'll rename to `assertNameMatchesValueSource`.
--
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]