/** Add to the document mapping if this property is included for this index. */
  public void docStoreMapping(DocMappingBuilder mapping, String prefix) {

    if (mapping.includesProperty(prefix, name)) {

      DocPropertyType type = scalarType.getDocType();
      DocPropertyOptions options = docOptions.copy();
      if (DocPropertyType.UUID == type || DocPropertyType.ENUM == type || isStringId(type)) {
        options.setCode(true);
      }

      mapping.add(new DocPropertyMapping(name, type, options));
    }
  }