You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "xunjian (Jira)" <ji...@apache.org> on 2021/10/28 09:06:00 UTC
[jira] [Commented] (LUCENE-10210) Indexsort is not correct(java.lang.RuntimeException: segment has indexSort=! missingValue=-9223372036854775808 selector=MAX type=LONG but docID=136 sorts after docID=137)
[ https://issues.apache.org/jira/browse/LUCENE-10210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17435267#comment-17435267 ]
xunjian commented on LUCENE-10210:
----------------------------------
I guess there is something wrong with indexsort when writing data.
I didn't reproduce this problem in the latest Lucene version, so I guess it may have been fixed, but I didn't find the relevant issue.
> 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
> Priority: Major
>
> 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: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org