Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-10598

SortedSetDocValues#docValueCount() should be always greater than zero

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.3
    • None
    • None
    • New

    Description

      This test runs failed.

        public void testDocValueCount() throws IOException {
            try (Directory d = newDirectory()) {
              try (IndexWriter w = new IndexWriter(d, new IndexWriterConfig())) {
                for (int j = 0; j < 1; j++) {
                  Document doc = new Document();
                  doc.add(new SortedSetDocValuesField("field", new BytesRef("a")));
                  doc.add(new SortedSetDocValuesField("field", new BytesRef("a")));
                  doc.add(new SortedSetDocValuesField("field", new BytesRef("b")));
                  w.addDocument(doc);
                }
              }
              try (IndexReader reader = DirectoryReader.open(d)) {
                assertEquals(1, reader.leaves().size());
                for (LeafReaderContext leaf : reader.leaves()) {
                  SortedSetDocValues docValues= leaf.reader().getSortedSetDocValues("field") ;
                  for (int doc1 = docValues.nextDoc(); doc1 != DocIdSetIterator.NO_MORE_DOCS; doc1 = docValues.nextDoc()) {
                    assert docValues.docValueCount() > 0;
                  }
                }
              }
          }
        }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            ChrisLu Lu Xugang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 10m
                1h 10m