{
  "$defs": {
    "SearchHit": {
      "description": "A single retrieval result.\n\nAttributes:\n    chunk_id: The matching chunk ID.\n    document_id: The parent document ID.\n    score: Similarity/relevance score (higher is better).\n    text: The chunk text.\n    metadata: Chunk metadata/provenance.",
      "properties": {
        "chunk_id": {
          "title": "Chunk Id",
          "type": "string"
        },
        "document_id": {
          "title": "Document Id",
          "type": "string"
        },
        "score": {
          "title": "Score",
          "type": "number"
        },
        "text": {
          "title": "Text",
          "type": "string"
        },
        "metadata": {
          "additionalProperties": true,
          "title": "Metadata",
          "type": "object"
        }
      },
      "required": [
        "chunk_id",
        "document_id",
        "score",
        "text"
      ],
      "title": "SearchHit",
      "type": "object"
    }
  },
  "description": "A ranked list of hits for a query.",
  "properties": {
    "query": {
      "title": "Query",
      "type": "string"
    },
    "collection": {
      "title": "Collection",
      "type": "string"
    },
    "hits": {
      "items": {
        "$ref": "#/$defs/SearchHit"
      },
      "title": "Hits",
      "type": "array"
    }
  },
  "required": [
    "query",
    "collection"
  ],
  "title": "SearchResult",
  "type": "object"
}
