Cross-Collection Search — MDDB API

Search across multiple collections using embeddings or text queries

Cross-collection vector search #

POST /v1/cross-search

Search across multiple collections using a source document's embedding vector or a text query. Useful for finding related content across different collection types (e.g., images matching blog post content).

Authorization: BearerAuth or APIKeyAuth or none

Request body #

Required.

Content type application/json: CrossSearchRequest

{
  "algorithm": "flat",
  "distanceMetric": "cosine",
  "explain": false,
  "feedbackMode": "query",
  "feedbackWeight": 0.5,
  "filter": {
    "kind": {
      "not": [
        "test"
      ]
    },
    "modified": {
      "gte": "2026-09-01"
    },
    "path": {
      "prefix": "internal/"
    },
    "size": {
      "lt": 10000
    },
    "summary": {
      "exists": true
    },
    "title": {
      "contains": "hnsw"
    }
  },
  "format": "results",
  "groupBy": {
    "key": "path",
    "perGroup": 1
  },
  "includeContent": false,
  "includeImages": false,
  "latencyTargetMs": 0,
  "negative": [
    "string"
  ],
  "oversample": 0,
  "passageLines": 0,
  "passageTokens": 0,
  "positive": [
    "string"
  ],
  "query": "machine learning tutorial",
  "queryVector": [
    0
  ],
  "rerank": {
    "candidates": 0,
    "enabled": false,
    "explain": false,
    "topN": 0
  },
  "rocchio": {
    "alpha": 1,
    "beta": 0.75,
    "gamma": 0.25
  },
  "searchType": "vector",
  "sourceCollection": "content",
  "sourceDocID": "post-123",
  "targetCollections": [
    "images",
    "audio"
  ],
  "threshold": 0.5,
  "topK": 10,
  "waitForIndex": 0,
  "waitForKeys": [
    "string"
  ]
}

Responses #

Status Description Body
200 Cross-collection search results CrossSearchResponse (application/json)
400 Invalid request ErrorResponse (application/json)
503 (v2.19.8, GO-053) Every search slot (MDDB_SEARCH_MAX_CONCURRENT) stayed taken for MDDB_SEARCH_QUEUE_TIMEOUT_MS. The query did not run; retry after Retry-After seconds. The same limit covers gRPC (RESOURCE_EXHAUSTED), GraphQL (the body below in the error's extensions) and MCP (a tool error with the body below as structuredContent). SearchBusy (application/json)