Portal Community
Atlas M10+ only. Atlas Search index management requires MongoDB Atlas M10 or above. Shared-tier clusters (M0, M2, M5) do not support programmatic search index creation. Attempting this operation on a self-hosted MongoDB instance returns a driver error.

When to Use

Configuration

Connection

FieldRequiredDescription
ConnectionUriRequiredMongoDB Atlas connection string. Reference via {{ $credentials.mongodbAtlas }}.
DatabaseRequiredDatabase containing the collection to index.
CollectionRequiredCollection to create the Atlas Search index on.

Operation

FieldRequiredDescription
IndexNameRequiredUnique name for the search index within the collection. Must be unique per collection — attempting to create a duplicate name raises an error. Use descriptive names that reflect the index purpose, e.g. product_text_search, ticket_fulltext_v2. Atlas Search always creates a default index named "default" if none exists.
DefinitionOptionalThe Atlas Search index definition as a JSON object. Default {} creates a dynamic index that automatically indexes all string fields. For production use, provide an explicit mappings object to control which fields are indexed, their types, and the analyzers applied. Supports all Atlas Search mapping types: string, number, date, boolean, document, embeddedDocuments, knnVector, token.
Asynchronous build. The index is created immediately and the operation returns the indexId. However the index will be in PENDING or BUILDING state and not queryable until the build completes. Build time depends on the number of existing documents in the collection — small collections may build in seconds; millions of documents may take minutes. Always poll searchindex/list for status: "READY" before running $search queries.

Sample Configuration

Create a product full-text search index with explicit field mappings for an e-commerce collection:

{
  "resource": "search-index",
  "operation": "create",
  "ConnectionUri": "{{ $credentials.mongodbAtlas }}",
  "Database": "ecommerce",
  "Collection": "products",
  "IndexName": "product_fulltext_search",
  "Definition": {
    "mappings": {
      "dynamic": false,
      "fields": {
        "name": {
          "type": "string",
          "analyzer": "lucene.standard",
          "searchAnalyzer": "lucene.standard"
        },
        "description": {
          "type": "string",
          "analyzer": "lucene.standard"
        },
        "category": {
          "type": "string",
          "analyzer": "lucene.keyword"
        },
        "brand": {
          "type": "string",
          "analyzer": "lucene.keyword"
        },
        "price": {
          "type": "number"
        },
        "inStock": {
          "type": "boolean"
        },
        "tags": {
          "type": "string",
          "analyzer": "lucene.standard"
        }
      }
    }
  }
}

Validation Errors

ErrorCause
connectionUri is requiredConnectionUri is empty or not provided.
database is requiredDatabase field is empty.
collection is requiredCollection field is empty.
indexName is requiredIndexName is empty or whitespace.

Output — Success Port

FieldTypeDescription
indexIdstringThe unique Atlas Search index ID assigned by MongoDB. Use this to reference the index in operational logging. The index may still be PENDING or BUILDING — use searchindex/list to check readiness.
statusstringAlways "success" on the success port — this means the creation request was accepted, not that the index is ready for queries.
resourcestringAlways "search-index".
operationstringAlways "create".

Sample Output

{
  "indexId": "64f2a0e1c3b4d5e6f7a8b903",
  "status": "success",
  "resource": "search-index",
  "operation": "create"
}

Expression Reference

ExpressionReturnsDescription
{{ $output.CreateSearchIndex.indexId }}stringThe Atlas-assigned index ID. Store in a variable for downstream reference.
{{ $output.CreateSearchIndex.status }}stringConfirm "success" — means the creation request was accepted by Atlas.

Node Policies & GuardRails

PolicyRecommendation
Credential storageAlways reference ConnectionUri from BizFirst Credentials Manager. Atlas Search index management uses the same credentials as document operations.
Check before createRun searchindex/list before creating an index to check whether an index with the same name already exists. Attempting to create a duplicate name on the same collection raises an error. Implement the list-then-create pattern to make provisioning workflows idempotent.
Always poll for READYThe success port returning means the request was accepted, not that the index is available. Always follow index creation with a polling loop using searchindex/list that checks for status == "READY" before continuing downstream steps that issue $search queries.
Explicit mappings over dynamicUse "dynamic": false with explicit field mappings for production indexes. Dynamic mapping automatically indexes every field and can consume excessive memory and compute on documents with many fields or deeply nested objects.
Choose the right analyzerUse lucene.standard for general text fields (tokenised, lowercased). Use lucene.keyword for exact-match fields like category, status, or brand. Use language-specific analyzers (lucene.french, lucene.japanese) for internationalised content. Wrong analyzer selection leads to poor search relevance.
knnVector requires dimensions matchWhen creating a vector search index, the dimensions value must exactly match the dimensionality of the vectors stored in the field. A mismatch causes all vector searches to return no results or raise errors.
Error port handlingConnect the error port to an alert node. A failed index creation in a deployment workflow must be surfaced immediately — silent failures leave the application running without search functionality.

Workflow Examples

Example 1 — Dynamic Index (Quick Setup)

{
  "resource": "search-index",
  "operation": "create",
  "ConnectionUri": "{{ $credentials.mongodbAtlas }}",
  "Database": "support",
  "Collection": "tickets",
  "IndexName": "default",
  "Definition": {}
}

Example 2 — Vector Search Index for AI Embeddings

{
  "resource": "search-index",
  "operation": "create",
  "ConnectionUri": "{{ $credentials.mongodbAtlas }}",
  "Database": "knowledge_base",
  "Collection": "articles",
  "IndexName": "article_vector_search",
  "Definition": {
    "mappings": {
      "dynamic": false,
      "fields": {
        "embedding": {
          "type": "knnVector",
          "dimensions": 1536,
          "similarity": "cosine"
        },
        "title": {
          "type": "string",
          "analyzer": "lucene.standard"
        },
        "tenantId": {
          "type": "string",
          "analyzer": "lucene.keyword"
        }
      }
    }
  }
}

Example 3 — Idempotent Provisioning Pattern

// Step 1: List existing indexes
{
  "resource": "search-index",
  "operation": "list",
  "ConnectionUri": "{{ $credentials.mongodbAtlas }}",
  "Database": "ecommerce",
  "Collection": "products"
}

// Step 2: IfCondition — check if "product_search" already exists
// indexes.some(i => i.name === "product_search")
//   true  → skip to poll loop
//   false → proceed to create

// Step 3: Create the index
{
  "resource": "search-index",
  "operation": "create",
  "ConnectionUri": "{{ $credentials.mongodbAtlas }}",
  "Database": "ecommerce",
  "Collection": "products",
  "IndexName": "product_search",
  "Definition": {
    "mappings": { "dynamic": true }
  }
}