LuXugang commented on PR #12349: URL: https://github.com/apache/lucene/pull/12349#issuecomment-1590716969
```java public void test111() throws IOException{ Directory dir = newDirectory(); IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random())); RandomIndexWriter indexWriter = new RandomIndexWriter(random(), dir, iwc); Document doc; Random random = new Random(); int count = 0; while (count++ < 100000){ doc = new Document(); doc.add(new SortedSetDocValuesField("sortedSet", new BytesRef("a"))); doc.add(new StringField("name", String.valueOf(random.nextInt(1000000)), StringField.Store.YES)); indexWriter.addDocument(doc); } indexWriter.commit(); IndexReader reader = indexWriter.getReader(); IndexSearcher searcher = newSearcher(reader); assert reader.maxDoc() == 100000; Query query = new MatchAllDocsQuery(); Sort sort = new Sort(new SortedSetSortField("field no exist ", false)); TopDocs noSearchField = searcher.search(query, 2000); assert noSearchField.totalHits.value == 2001; TopDocs hasSearchField = searcher.search(query, 2000, sort); // if the search sort field is not exist, should early terminate after Top 2000 collected? assert hasSearchField.totalHits.value == 100000; indexWriter.close(); reader.close(); dir.close(); } ``` If search sort field does not exist, should we early terminate collection after TopN collected? -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org