Product Selector

Fusion 5.9
    Fusion 5.9

    Call Pipeline Stage

    The Call Pipeline query stage calls another query pipeline. You can use this stage to reuse pipeline logic across multiple pipelines. You can also use it to check for null results, look up related queries, perform fallback queries, and so on.

    In the context of a query pipeline, the Call Pipeline stage creates a "subroutine" that pauses the main pipeline while the called pipeline completes its operations. The called pipeline returns its output to the pipeline that called it, as input for the next pipeline stage. Note that this is different than Call Pipeline stages in index pipelines, where the called pipeline does not return its output to the pipeline that called it.

    In the example illustrated below, a Call Pipeline stage invokes a query pipeline that looks up related items and returns those results to the main pipeline as the input to the next pipeline stage:

    A Call Pipeline stage in a query pipeline

    The main pipeline then continues processing the query.

    Use a naming convention for your pipelines that lets you easily differentiate between your main pipelines and the ones you are using as call pipelines. For example, you can add a suffix like _cpl to differentiate your call pipelines from other pipelines.

    Lucidworks offers free training to help you get started.

    The Quick Learning for Using Call Pipelines focuses on how the Call Pipeline stage works differently in index pipelines versus query pipelines and how to use it in both:

    Using Call Pipelines

    Visit the LucidAcademy to see the full training catalog.

    Lucidworks offers free training to help you get started.

    The Course for Call Pipelines focuses on how to implement reusable pipelines and call them from other pipelines:

    Call Pipelines

    Visit the LucidAcademy to see the full training catalog.

    Query pipeline stage condition examples

    Stages can be triggered conditionally when a script in the Condition field evaluates to true. Some examples are shown below.

    Run this stage only for mobile clients:

    params.deviceType === "mobile"

    Run this stage when debugging is enabled:

    params.debug === "true"

    Run this stage when the query includes a specific term:

    params.q && params.q.includes("sale")

    Run this stage when multiple conditions are met:

    request.hasParam("fusion-user-name") && request.getFirstParam("fusion-user-name").equals("SuperUser");
    !request.hasParam("isFusionPluginQuery")

    The first condition checks that the request parameter "fusion-user-name" is present and has the value "SuperUser". The second condition checks that the request parameter "isFusionPluginQuery" is not present.

    Configuration

    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.

    Call another Fusion query pipeline

    skip - boolean

    Set to true to skip this stage.

    Default: false

    label - string

    A unique label for this stage.

    <= 255 characters

    condition - string

    Define a conditional script that must result in true or false. This can be used to determine if the stage should process or not.

    pipelineToRun - stringrequired

    collection - string

    solrHandler - string