Github user moshebla commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/395#discussion_r195098134
  
    --- Diff: solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java 
---
    @@ -570,37 +573,34 @@ private SolrInputDocument parseDoc(int ev) throws 
IOException {
         private void parseFieldValue(SolrInputField sif) throws IOException {
           int ev = parser.nextEvent();
           if (ev == JSONParser.OBJECT_START) {
    -        parseExtendedFieldValue(sif, ev);
    +        parseExtendedFieldValue(ev, sif);
           } else {
             Object val = parseNormalFieldValue(ev, sif);
             sif.setValue(val);
           }
         }
     
    -    private void parseExtendedFieldValue(SolrInputField sif, int ev) 
throws IOException {
    +    private void parseExtendedFieldValue(int ev, SolrInputField sif) 
throws IOException {
           assert ev == JSONParser.OBJECT_START;
     
    -      SolrInputDocument extendedSolrDocument = 
generateExtendedValueDoc(ev);
    +      SolrInputDocument extendedSolrDocument = parseExtendedValueAsDoc(ev);
     
           if (isChildDoc(extendedSolrDocument)) {
    -        SolrInputDocument cDoc = new SolrInputDocument();
    -        for (Map.Entry<String, SolrInputField> extendedEntry: 
extendedSolrDocument.entrySet()) {
    -          cDoc.setField(extendedEntry.getKey(), 
extendedEntry.getValue().getValue());
    -        }
    -        sif.addValue(cDoc);
    +        sif.addValue(extendedSolrDocument);
             return;
           }
     
           Object normalFieldValue = null;
           Map<String, Object> extendedInfo = null;
     
    -      for (String label: extendedSolrDocument.keySet() ) {
    -        Object fieldVal = extendedSolrDocument.get(label).getValue();
    -        if ("boost".equals(label)) {
    +      for (SolrInputField field: extendedSolrDocument) {
    +        Object fieldVal = field.getValue();
    +        String fieldName = field.getName();
    --- End diff --
    
    Just tackled this one.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to