> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Call Data Model Pipeline Index Stage

[localhost link]: http://localhost:3000/docs/5/fusion/reference/config-ref/pipeline-stages/index-stages/call-datamodel-pipeline-index-stage

[mintlify link]: https://doc.lucidworks.com/docs/5/fusion/reference/config-ref/pipeline-stages/index-stages/call-datamodel-pipeline-index-stage.md

[old doc.lw link]: https://doc.lucidworks.com/fusion/5.9/8841.md

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.

The Call Data Model Pipeline index stage is used to create a link between your document type (person, email, file, etc.) and your documents.

> [!TIP]
>
> **Important**
>
> This index stage must be placed *after* the **[Data Model Mapping index stage](https://doc.lucidworks.com/docs/5/fusion/reference/config-ref/pipeline-stages/index-stages/datamodel-mapping-index-stage.md)**.

> [card] Key questions to get you started
>
> Powered by Lucidworks Agent Studio

## More information

* **Configure a Data Model**
* [Data Models](https://doc.lucidworks.com/docs/5/fusion/getting-data-in/indexing/data-models/overview.md)
* [Data Models API reference](https://doc.lucidworks.com/api-reference/data-models/get-data-models-service-status.md)
* [Data Model Mapping Index Stage reference](https://doc.lucidworks.com/docs/5/fusion/reference/config-ref/pipeline-stages/index-stages/datamodel-mapping-index-stage.md)

> [accordion] 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](https://doc.lucidworks.com/docs/5/fusion/getting-data-in/indexing/data-models/overview.md) topic for more information.
>
> ## Configure the datasource
>
> > [!TIP]
> >
> > This section references the Slack V2 Connector.
>
> 1. Navigate to **Indexing > Datasources**.
>
> 2. Click the **Add** button, and choose the Slack V2 connector from the list.
>
>    > [!NOTE]
>    >
>    > 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 using the information in [Configure the index pipeline](#configure-the-index-pipeline).
>
>    * Under **Profiles Settings**, select *Index profiles*:
>
>      ![Slack V2 Configuration 01](https://mintcdn.com/lucidworks/tklssWuUmNaxlF0b/assets/images/5.4/slack-v2-config01.png?fit=max\&auto=format\&n=tklssWuUmNaxlF0b\&q=85\&s=eb49319c9ceffd045cf5af1869462523)
>
>    * Under **Channels and Messages Settings**, select *Index channels* and *Index from public channels*:
>
>      ![Slack V2 Configuration 02](https://mintcdn.com/lucidworks/tklssWuUmNaxlF0b/assets/images/5.4/slack-v2-config02.png?fit=max\&auto=format\&n=tklssWuUmNaxlF0b\&q=85\&s=36d4935ad22c8b9b4f22e598c2a64482)
>
> 4. Click **Save**.
>
> 5. Click **Run** to run the indexing job.
>
> ## 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. For example, `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](https://doc.lucidworks.com/api-reference/data-models/get-data-models-service-status.md). 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](https://mintcdn.com/lucidworks/aGMTh7KKUIwUyuv7/assets/images/5.3/data-models-person-revised.png?fit=max\&auto=format\&n=aGMTh7KKUIwUyuv7\&q=85\&s=71ebd18648ebd091e6bdc3364f9279d2)
>
> 8. If needed, edit the JSON for the data model before saving. After saving the data model, this JSON viewer becomes read-only.
>
>    ![Data Models JSON Editor](https://mintcdn.com/lucidworks/rCk05FGao1tZ6RSO/assets/images/5.4/ui-json-editor.png?fit=max\&auto=format\&n=rCk05FGao1tZ6RSO\&q=85\&s=f0063fa74481ce1e7425508d4e940af1)
>
> 9. Click the **Save** button to save the data model.
>
> ## 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.
>
> > [!TIP]
> >
> > The raw data fields in your index coming from Slack may differ from the example data fields used in this article.
>
> ### 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` |
>
>    > [!TIP]
>    >
>    > The **Value to match** field supports RegEx. You can assign multiple values. Alternatively, you can create additional **Data Model Mapping** stages.
> 4. 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` |
> 5. *(optional)* Check the **Keep unmapped fields** checkbox to preserve fields that are unmatched to the data model.
> 6. Click **Apply**.
>
> ### Call Data Model Pipeline stage
>
> > [!TIP]
> >
> > 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`.
>
> ## More information
>
> * [Data Models](https://doc.lucidworks.com/docs/5/fusion/getting-data-in/indexing/data-models/overview.md)
> * [Data Models API reference](https://doc.lucidworks.com/api-reference/data-models/get-data-models-service-status.md)
> * [Data Model Mapping Index Stage reference](https://doc.lucidworks.com/docs/5/fusion/reference/config-ref/pipeline-stages/index-stages/datamodel-mapping-index-stage.md)
> * [Call Data Model Pipeline Index Stage reference](https://doc.lucidworks.com/docs/5/fusion/reference/config-ref/pipeline-stages/index-stages/call-datamodel-pipeline-index-stage.md)

## Configuration

> [!TIP]
>
> When entering configuration values in the UI, use *unescaped* characters, such as `\t` for the tab character. When entering configuration values in the API, use *escaped* characters, such as `\\t` for the tab character.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.