Profile maps for Lucene and Solr

Due to the dynamic nature of the Commerce Server profile indexing strategy, the field map is generated dynamically. You do not have to define the fields in configuration. The fields will be added automatically through field map providers.

By default, both Lucene and Solr field map providers have been added.

You can bypass the field map providers and manually add the fields to be indexed in configuration. Do this by replacing the configuration section of the index definition with the default technology specific Sitecore field map provider.

The following profile field map providers are available for Lucene and Solr:

  • ProfileLuceneFieldMap
  • ProfileSolrFieldMap

The following is an example of the Lucene user profiles index definition. For clarity, configuration elements not related to this configuration have been removed.

<commerceLuceneProfileUserObjectIndexConfiguration 
       type="Sitecore.ContentSearch.LuceneProvider.LuceneIndexConfiguration, 
             Sitecore.ContentSearch.LuceneProvider">
          
  <fieldMap 
      type="Sitecore.Commerce.Connect.CommerceServer.Search.ProfileLuceneFieldMap, 
            Sitecore.Commerce.Connect.CommerceServer">
        <param desc="profileType">UserObject</param>
        <param desc="additionalFields">_content</param>
    </fieldMap>
</commerceLuceneProfileUserObjectIndexConfiguration>

The fieldMap element tells Sitecore which profile map provider to use. By default, Sitecore uses the Commerce Server Connect profile map provider. If you wish to define the fields manually, you can simply change the fieldMap type to the default Sitecore version. For example: <fieldMap type="Sitecore.ContentSearch.FieldMap, Sitecore.ContentSearch">

At this point, you will be required to define the field map profile fields manually in configuration.

<fieldMap type="Sitecore.ContentSearch.FieldMap, Sitecore.ContentSearch">
    <fieldNames hint="raw:AddFieldByFieldName">
        <field fieldName="email_address"  storageType="YES" indexType="TOKENIZED" 
               vectorType="NO" boost="1f" type="System.String" 
               settingType="Sitecore.ContentSearch.LuceneProvider.
              LuceneSearchFieldConfiguration, Sitecore.ContentSearch.LuceneProvider">
        <Analyzer
            type="Sitecore.ContentSearch.LuceneProvider.Analyzers.
             LowerCaseKeywordAnalyzer, Sitecore.ContentSearch.LuceneProvider" />
        </field>
    </fieldNames>
</fieldMap>

The same type of configuration exists for Solr.