message: more refactoring to prepare for computed attributes
diff: @@ -39,23 +39,24 @@ module.exports = class DocumentContext {
  return;
  }
  - let pristineAttributes = {};
  - pristineDocOut.data.attributes = pristineAttributes;
  + pristineDocOut.data.attributes = {};
  for (let field of contentType.realFields.values()) {
  if (field.id === 'id' || field.id === 'type' || field.isRelationship) {
  continue;
  }
  let value = jsonapiDoc.attributes[field.id];
  + await this._buildAttribute(field, value, pristineDocOut, searchDocOut);
  + }
  + }
  + async _buildAttribute(field, value, pristineDocOut, searchDocOut) {
  // Write our value into the search doc
  - {
  let esName = await this._logicalFieldToES(field.id);
  searchDocOut[esName] = value;
  - }
  // Write our value into the pristine doc
  - pristineAttributes[field.id] = value;
  + pristineDocOut.data.attributes[field.id] = value;
  // If the search plugin has any derived fields, those also go
  // into the search doc.
  @@ -67,7 +68,6 @@ module.exports = class DocumentContext {
  }
  }
  }
  - }
  async _buildRelationships(contentType, jsonapiDoc, pristineDocOut, searchDocOut, searchTree, depth) {
  if (!jsonapiDoc.relationships) {
  