code: private I_CmsSearchFieldMapping createSearchFieldMapping(
          CmsXmlContentDefinition contentDefinition,
          Element element,
          Locale locale)
      throws CmsXmlException {
  
          I_CmsSearchFieldMapping fieldMapping = null;
          String typeAsString = element.attributeValue(APPINFO_ATTR_TYPE);
          CmsSearchFieldMappingType type = CmsSearchFieldMappingType.valueOf(typeAsString);
          switch (type.getMode()) {
              case 0: // content
              case 3: // item
                  // localized
                  String param = locale.toString() + "|" + element.getStringValue();
                  fieldMapping = new CmsSearchFieldMapping(type, param);
                  break;
              case 1: // property
              case 2: // property-search
              case 5: // attribute
                  // not localized
                  fieldMapping = new CmsSearchFieldMapping(type, element.getStringValue());
                  break;
              case 4: // dynamic
                  String mappingClass = element.attributeValue(APPINFO_ATTR_CLASS);
                  if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(mappingClass)) {
                      try {
                          fieldMapping = (I_CmsSearchFieldMapping)Class.forName(mappingClass).newInstance();
                          fieldMapping.setType(CmsSearchFieldMappingType.DYNAMIC);
                          fieldMapping.setParam(element.getStringValue());
                      } catch (Exception e) {
                          throw new CmsXmlException(
                              Messages.get().container(
                                  Messages.ERR_XML_SCHEMA_MAPPING_CLASS_NOT_EXIST_3,
                                  mappingClass,
                                  contentDefinition.getTypeName(),
                                  contentDefinition.getSchemaLocation()));
                      }
  
                  }
                  break;
              default:
                  // NOOP
          }
          if (fieldMapping != null) {
              fieldMapping.setDefaultValue(element.attributeValue(APPINFO_ATTR_DEFAULT));
          }
          return fieldMapping;
      }
docs: Creates a search field mapping for the given mapping element and the locale.<p>
  
  @param contentDefinition the content definition
  @param element the mapping element configured in the schema
  @param locale the locale
  
  @return the created search field mapping
  
  @throws CmsXmlException if the dynamic field class could not be found