{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-content-source-search-response-schema.json",
  "title": "ContentSourceSearchResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-aem-content-ai-openapi.yml#/components/schemas/ContentSourceSearchResponse",
  "type": "object",
  "required": [
    "totalResults",
    "results"
  ],
  "properties": {
    "totalResults": {
      "type": "integer",
      "format": "int64",
      "description": "Total number of results matching for the given query.\n\nThe totalResults count is only guaranteed to be accurate up to 10,000 documents. Beyond that threshold, the count should be treated as an upper-bound indicator rather than an exact value.\n\nThis value can be greater than the number of results fetched as part of\nthe query execution based on the\n\npagination options defined in the query.\n"
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ContentResultData"
      }
    },
    "cursor": {
      "type": "string",
      "description": "The cursor to be used for the next page of results.\n\nIt is an opaque string that can be used in API calls which support\npaginating the response.\n\nA non-existent cursor signifies that the returned list does not have more\nelements.\n"
    },
    "aggregates": {
      "description": "Aggregates calculated for the query. These aggregates are calculated on the\nsearch results and can be used to either filter the results (based on bucket aggregation) or get stats of particular fields (using stats aggregation).\n\nThe aggregates are returned as a list which can comprise of different type of aggregate result objects like term buckets or number stats.\nEach result object will have a `id` which is a unique identifier for that aggregate configuration as specified in the search request.\nBased on the type of aggregates result, the object will have additional properties.\n",
      "type": "array",
      "items": {
        "$ref": "#/$defs/AggregatesResultData"
      }
    }
  },
  "$defs": {
    "AggregatesResultData": {
      "type": "object",
      "required": [
        "field",
        "type",
        "id"
      ],
      "properties": {
        "type": {
          "$ref": "#/$defs/AggregatesType"
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "A unique identifier for this aggregate configuration. This id was specified in the search request to identify which aggregate this result corresponds to.\n"
        },
        "field": {
          "type": "string",
          "minLength": 1,
          "description": "The field on which aggregation was performed. This is typically a field in the document that you want to either filter on (bucket aggregation) or get the stats for.\n"
        }
      }
    },
    "AggregatesType": {
      "type": "string",
      "minLength": 1,
      "description": "The type of aggregation required on the specified field.\n- `termBuckets`: Term bucketing is used to get the unique values for a field and their respective counts.\n                 This is applicable for both string fields and non string (boolean, number and date) fields.\n- `numberStats`: Number stats aggregation is used to get statistical information field,\n                 such as count, min, max, average, and sum. This is applicable only for non string fields like number,\n                 boolean and date fields.\n                 Requesting this aggregation on a string field will result in an error.\n",
      "enum": [
        "termBuckets",
        "numberStats"
      ]
    },
    "ChunkResultData": {
      "type": "object",
      "required": [
        "id",
        "score"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "ID of the chunk/vector document"
        },
        "score": {
          "type": "number",
          "format": "double",
          "description": "Relevance score of the chunk"
        },
        "chunkData": {
          "type": "object",
          "additionalProperties": {},
          "description": "Metadata of the chunk"
        }
      }
    },
    "ContentResultData": {
      "type": "object",
      "required": [
        "id",
        "score",
        "data"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "ID of the returned document. This is the same id provided at the time of ingestion."
        },
        "score": {
          "type": "number",
          "format": "double",
          "description": "Relevance score of the document."
        },
        "data": {
          "type": "object",
          "additionalProperties": {},
          "description": "Original content of the document that was ingested."
        },
        "chunks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ChunkResultData"
          },
          "description": "List of chunks from the document. Only populated for vector queries if configured in the query options."
        },
        "eTag": {
          "type": "string",
          "description": "The current entity tag for the document, allowing clients to use it for optimistic concurrency control during document updates. This field is included only if the `eTag` option is set to true in the query options."
        }
      }
    }
  }
}