Product Selector

Fusion 5.12
    Fusion 5.12

    Configure a Data Model

    Data models simplify the process of getting started with Fusion by providing pre-configured objects to reduce the effort spent on basic starting tasks. This helps keep documents consistent between datasources and intuitive to the object’s type.

    See the Data Models topic for more information.

    1. Configure the datasource

    This section references the Slack V2 Connector, which was introduced in Fusion 5.4.0. However, Data Models were introduced in Fusion 5.3.0. The instructions on configuring the data model are valid for any connector in Fusion 5.3.0+ that indexes users.
    1. Navigate to Indexing > Datasources.

    2. Click the Add button, and choose the Slack V2 connector from the list.

      Some connectors include built-in data models as a standard component. Others require you to manually create data models.
    3. Complete the datasource configuration:

      • Ideally, use a pipeline specifically created for this data model. For now, you can create the pipeline by navigating to Indexing > Index Pipelines and clicking the Add button. Configure it later as described below.

      • Under Profiles Settings, select Index profiles:

        Slack V2 Configuration 01

      • Under Channels and Messages Settings, select Index channels and Index from public channels:

        Slack V2 Configuration 02

    4. Click Save.

    5. Click Run to run the indexing job.

    2. Configure the data model

    Some connectors include built-in data models with pre-configured object types. However, you can add new data models or customize existing ones to fit your particular needs.

    1. Navigate to Indexing > Data Models.

    2. Click the Add button.

    3. Create a new data model, person.

    4. Assign the index pipeline for the data model. In this example, create a new index pipeline named companyDirectory-data-pipeline.

      This pipeline is ideally for operation with data models only. For the sake of this example, we will only be using the default stages. Applying additional logic/stages specific to the object would occur here.

    5. Assign the query pipeline you will use to query the indexed documents. In this example, create a new query pipeline named companyDirectory-query-pipeline.

    6. Click the New button under Fields Configuration.

    7. Complete the required configurations, as detailed in Data Models API Reference. Create fields for the following:

      Field Name Solr Fields

      first_name

      firstName_t, firstName_s

      last_name

      lastName_t, lastName_s

      email

      email_s

      job_title

      jobTitle_t, jobTitle_s

      Data Models Person

    8. If needed, edit the JSON for the data model.

      Data Models JSON Editor

    9. Click the Save button to save the data model.

    3. Configure the index pipeline

    To begin, navigate to Indexing > Index Workbench. Alternatively, the companyDirectory-index-pipeline pipeline can be configured in Indexing > Index Pipelines, but you are not able to preview results.

    The raw data fields in your index coming from Slack may differ from the example data fields used in this article.

    3.1. Data Model Mapping stage

    1. Click the Add a Stage button, and choose Data Model Mapping from the list.

    2. Use the Data Model Type dropdown to select the person data model.

    3. (optional) Check the Match Trigger checkbox and assign the following values:

      Field Value

      Field to match

      type_s

      Value to match

      user

      The Value to match field supports RegEx. You can assign multiple values. Alternatively, you can create additional Data Model Mapping stages.
    1. Assign field mappings for the Slack datasource’s raw datasources:

      Source Field Data Model Field

      first_name

      first_name

      last_name

      last_name

      email

      email

    2. (optional) Check the Keep unmapped fields checkbox to preserve fields that are unmatched to the data model.

    3. Click Apply.

    3.2. Call Data Model Pipeline stage

    This stage must be placed after the Data Model Mapping stage.
    1. Click the Add a Stage button, and choose Call Data Model Pipeline from the list.

    2. Assign the value _lw_data_model_type_s to the Data Model Type Field field. This field is created when a document meets the criteria specified in the Data Model Mapping.

    3. Click Apply.

    Next steps

    With the index pipeline configured, you are now ready to complete the indexing job by clicking the Start Job button.

    Once complete, the documents are ready for viewing in the Query Workbench:

    1. Navigate to Querying > Query Workbench.

    2. Click the Load button.

    3. Choose the query pipeline you specified when creating the data model, companyDirectory-query-pipeline.