File tree Expand file tree Collapse file tree
solr/core/src/java/org/apache/solr/response/transform Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,15 +84,16 @@ public void setContext(ResultContext context) {
8484
8585 FunctionValues values = null ;
8686 int docBase = -1 ;
87- int currentIdx = - 1 ;
87+ int nextDocBase = 0 ; // i.e. this segment's maxDoc
8888 for (int docid : ids ) {
89- int idx = ReaderUtil .subIndex (docid , readerContexts );
90- if (currentIdx != idx ) {
91- currentIdx = idx ;
89+ if (docid >= nextDocBase ) {
90+ int idx = ReaderUtil .subIndex (docid , readerContexts );
9291 LeafReaderContext rcontext = readerContexts .get (idx );
9392 docBase = rcontext .docBase ;
93+ nextDocBase = docBase + rcontext .reader ().maxDoc ();
9494 values = valueSource .getValues (fcontext , rcontext );
9595 }
96+
9697 int localId = docid - docBase ;
9798 var value = values .objectVal (localId );
9899 cachedValuesById .put (docid , value != null ? value : NULL_SENTINEL );
You can’t perform that action at this time.
0 commit comments