title: How to include imported fields in the search results?
body: <p>I'm using <a href="http://docs.vespa.ai/documentation/search-definitions.html#document-references" rel="nofollow noreferrer">document references</a> to import parent fields into a child document. While searches against the parent fields work, the parent fields themselves do not seem to be included in the search results, only child fields.</p>
  
  <p>To use the example in the documentation, <code>salesperson_name</code> does <em>not</em> appear in the <code>fields</code> entry for <code>id:test:ad::1</code> when using <code>query=John</code>, or indeed when retrieving <code>id:test:ad::1</code> via <code>GET</code> directly.</p>
  
  <p>Here's a simplified configuration for my document model:</p>
  
  <h1>search definitions</h1>
  
  <h2>person.sd - the parent</h2>
  
  <pre><code>search person {
    document person {
      field name type string {
        indexing: summary | attribute
      }
    }
  
    fieldset default {
      fields: name
    }
  }
  </code></pre>
  
  <h2>event.sd - the child</h2>
  
  <pre><code>search event {
    document event {
      field code type string {
        indexing: summary | attribute
      }
      field speaker type reference&lt;person&gt; {
        indexing: summary | attribute
      }
    }
  
    import field speaker.name as name {}
  
    fieldset default {
      fields: code
    }
  }
  </code></pre>
  
  <h1>documents</h1>
  
  <h2>p1 - person</h2>
  
  <pre><code>{
    "fields": {
      "name": "p1"
    }
  }
  </code></pre>
  
  <h2>e1 - event</h2>
  
  <pre><code>{
    "fields": {
      "code": "e1",
      "speaker": "id:n1:person::1"
    }
  }
  </code></pre>
  
  <h2>query result</h2>
  
  <p><code>curl -s "http://localhost:8080/search/?yql=select%20*%20from%20sources%20*where%20name%20contains%20%22p1%22%3B" | python -m json.tool</code></p>
  
  <p>This returns both e1 and p1, as you would expect, given that <code>name</code> is present in both. <em>But</em> the <code>fields</code> of <code>e1</code> do not include the <code>name</code>.</p>
  
  <pre><code>{
    "root": {
      "children": [
        {
          "fields": {
            "documentid": "id:n1:person::1",
            "name": "p1",
            "sddocname": "person"
          },
          "id": "id:n1:person::1",
          "relevance": 0.0017429193899782135,
          "source": "music"
        },
        {
          "fields": {
            "code": "e1",
            "documentid": "id:n1:event::1",
            "sddocname": "event",
            "speaker": "id:n1:person::1"
          },
          "id": "id:n1:event::1",
          "relevance": 0.0017429193899782135,
          "source": "music"
        }
      ],
      ...
      "fields": {
        "totalCount": 2
      },
    }
  }
  </code></pre>