nick-boss-tech commented on code in PR #5298:
URL: https://github.com/apache/solr/pull/5298#discussion_r4773401844


##########
solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java:
##########
@@ -346,10 +352,21 @@ public void process(ResponseBuilder rb) throws 
IOException {
 
         if (docid < 0) continue;
 
-        SolrDocumentFetcher docFetcher = 
searcherInfo.getSearcher().getDocFetcher();
-        Document luceneDocument =
-            docFetcher.doc(docid, rsp.getReturnFields().getLuceneFieldNames());
-        SolrDocument doc = toSolrDoc(luceneDocument, 
searcherInfo.getSearcher().getSchema());
+        SolrIndexSearcher searcher = searcherInfo.getSearcher();
+        @SuppressWarnings("ReferenceEquality") // cache key is the searcher 
instance
+        final boolean searcherChanged = docFetcher == null || searcher != 
fieldSelectionSearcher;
+        if (searcherChanged) {
+          fieldSelectionSearcher = searcher;
+          docFetcher = searcher.getDocFetcher();
+          storedFields =
+              useLegacyStoredFields

Review Comment:
   Done; getStoredFieldsToLoad now makes that call itself, and 
RealTimeGetComponent just asks the fetcher. The conversion call in RTG still 
branches on it, because toSolrDoc's field filtering is the other half of the 
legacy behavior: a transformer that reads undeclared fields must not have them 
filtered out at conversion.
   
   🤖 *AI-generated text above* 🤖



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to