xunjian created LUCENE-10210:
--------------------------------

             Summary: Indexsort is not correct(java.lang.RuntimeException: 
segment has indexSort=<sortednumeric: "time">! 
missingValue=-9223372036854775808 selector=MAX type=LONG but docID=136 sorts 
after docID=137)
                 Key: LUCENE-10210
                 URL: https://issues.apache.org/jira/browse/LUCENE-10210
             Project: Lucene - Core
          Issue Type: Bug
          Components: core/index
    Affects Versions: 7.2.1
            Reporter: xunjian


Sequence of test:
 # create an index with indexsort(final SortField sortField = new 
SortedNumericSortField("time", SortField.Type.LONG, true, 
SortedNumericSelector.Type.MAX);sortField.setMissingValue(Long.MIN_VALUE);Sort 
sort = new Sort(sortField);)
 # index 200 docs (time is null)
 # index 600 docs (time is not null )
 # index 100 docs (time is null)
 # conmit and flush
 # search
 ** final int numHits = 3;
 final SortField sortField = new SortedNumericSortField("time", 
SortField.Type.LONG, true, SortedNumericSelector.Type.MAX);
 sortField.setMissingValue(Long.MIN_VALUE);
 final TopFieldCollector collector = TopFieldCollector.create(new 
Sort(sortField), numHits, null, true, false, false, false);
 final Query query = new MatchAllDocsQuery();
 searcher.search(query, collector);
 TopDocs td = collector.topDocs();
 # assert
 ** long time = ((FieldDoc) td.scoreDocs[0]).fields[0]
 ** System.out.println(time);

problem:
 # the time is not what I expected
 # when close the index reader, I got the error: java.lang.RuntimeException: 
segment has indexSort=<sortednumeric: "time">! 
missingValue=-9223372036854775808 selector=MAX type=LONG but docID=136 sorts 
after docID=137.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to