Query results from OpenSearch

This example pipeline demonstrates how to generate an embedding vector and use it to query results from the OpenSearch database.

  1. Configure the JSON Generator Snap to pass your input data to query.

    JSON Generator - Edit JSON

  2. Configure the Azure OpenAI Embedder Snap to generate embedding vectors for input data based on the Deployment ID, Batch size, and input document.
    On validation, the input data from the upstream Snap is processed into embedded vectors and you can view the data in the output preview.
    Azure OpenAI Embedder Snap Configuration Azure OpenAI Embedder Snap Output

    Azure OpenAI Embedder Snap Configuration


    Azure OpenAI Embedder Snap Output

  3. Configure the Mapper Snap with the generated embeddings with $vector, ensuring the embeddings are correctly mapped for the subsequent query.

    Mapper Snap Configuration

  4. Configure the OpenSearch Query Snap with the Index name and Vector field name, then select the relevant Search method and space type to use the embedding vector for retrieving results.
    On validation, the Snap retrieves the top matching vectors closest to the specified vector in the OpenSearch index and, as configured, outputs the corresponding mappings for those vectors.
    OpenSearch Query Snap Configuration OpenSearch Query Snap Output

    OpenSearch Query Snap Configuration


    OpenSearch Query Snap Output

To successfully reuse pipelines:
  1. Download and import the pipeline into SnapLogic Platform.
  2. Configure Snap accounts, as applicable.
  3. Provide pipeline parameters, as applicable.