dsmiley commented on code in PR #5298:
URL: https://github.com/apache/solr/pull/5298#discussion_r4786363283
##########
solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java:
##########
@@ -906,8 +920,18 @@ private static SolrInputDocument
toSolrInputDocument(SolrDocument doc, IndexSche
}
private static SolrDocument toSolrDoc(Document doc, IndexSchema schema) {
+ return toSolrDoc(doc, schema, null);
+ }
+
+ private static SolrDocument toSolrDoc(
+ Document doc, IndexSchema schema, ReturnFields returnFields) {
SolrDocument out = new SolrDocument();
for (IndexableField f : doc.getFields()) {
+ // The eager field set does not restrict an existing cache entry, which
can contain lazy
+ // fields. Keep transformer inputs, but don't materialize unrelated
fields.
+ if (returnFields != null && !returnFields.loadsField(f.name())) {
+ continue;
+ }
Review Comment:
in the event of `useLegacyStoredFields` (a transformer needs all fields
loaded), couldn't the returnFields internals be manipulated in this event such
that loadsField(name) always returns true? I'm trying to reduce special case
branching outside of ReturnFields, thus simplifying how to use ReturnFields.
--
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]