dsmiley commented on code in PR #5328:
URL: https://github.com/apache/solr/pull/5328#discussion_r4594554017


##########
solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java:
##########
@@ -988,13 +1000,37 @@ public static SolrDocument toSolrDoc(
     // TODO: do something more performant than this double conversion
     Document doc = DocumentBuilder.toDocument(sdoc, schema, forInPlaceUpdate, 
true);
 
+    Map<String, List<Number>> rawVectorFields = new HashMap<>();
+
     // copy the stored fields only
     Document out = new Document();
     for (IndexableField f : doc.getFields()) {
+      SchemaField schemaField = schema.getFieldOrNull(f.name());

Review Comment:
   again; crossing a complexity threshold.  The instanceof checks are a code 
smell suggesting we need better abstractions / infrastructural mechanisms.



##########
solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java:
##########
@@ -876,7 +884,11 @@ private static SolrInputDocument 
toSolrInputDocument(SolrDocument doc, IndexSche
       boolean fieldArrayListCreated = false;
       SchemaField sf = schema.getFieldOrNull(fname);
       if (sf != null) {
-        if ((!sf.hasDocValues() && !sf.stored()) || 
schema.isCopyFieldTarget(sf)) continue;
+        if ((!sf.hasDocValues() && !sf.stored() && !sf.useRawVectorsAsStored())
+            || schema.isCopyFieldTarget(sf)) continue;
+        if (sf.getType() instanceof DenseVectorField) {
+          out.setField(fname, new ArrayList<>());
+        }

Review Comment:
   IMO this has crossed a complexity threshold that suggests we don't add just 
another more condition here.   Could just be an extracted method that is 
heavily commented.



-- 
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