{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elastic/json-schema/elastic-global-mtermvectors-operation-schema.json",
  "title": "_global.mtermvectors.Operation",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elastic-document-api-openapi.yml#/components/schemas/_global.mtermvectors.Operation",
  "type": "object",
  "properties": {
    "_id": {
      "description": "The ID of the document.",
      "allOf": [
        {
          "$ref": "#/$defs/_types.Id"
        }
      ]
    },
    "_index": {
      "description": "The index of the document.",
      "allOf": [
        {
          "$ref": "#/$defs/_types.IndexName"
        }
      ]
    },
    "doc": {
      "description": "An artificial document (a document not present in the index) for which you want to retrieve term vectors.",
      "type": "object"
    },
    "fields": {
      "description": "Comma-separated list or wildcard expressions of fields to include in the statistics.\nUsed as the default list unless a specific field list is provided in the `completion_fields` or `fielddata_fields` parameters.",
      "allOf": [
        {
          "$ref": "#/$defs/_types.Fields"
        }
      ]
    },
    "field_statistics": {
      "description": "If `true`, the response includes the document count, sum of document frequencies, and sum of total term frequencies.",
      "default": true,
      "type": "boolean"
    },
    "filter": {
      "description": "Filter terms based on their tf-idf scores.",
      "allOf": [
        {
          "$ref": "#/$defs/_global.termvectors.Filter"
        }
      ]
    },
    "offsets": {
      "description": "If `true`, the response includes term offsets.",
      "default": true,
      "type": "boolean"
    },
    "payloads": {
      "description": "If `true`, the response includes term payloads.",
      "default": true,
      "type": "boolean"
    },
    "positions": {
      "description": "If `true`, the response includes term positions.",
      "default": true,
      "type": "boolean"
    },
    "routing": {
      "description": "Custom value used to route operations to a specific shard.",
      "allOf": [
        {
          "$ref": "#/$defs/_types.Routing"
        }
      ]
    },
    "term_statistics": {
      "description": "If true, the response includes term frequency and document frequency.",
      "default": false,
      "type": "boolean"
    },
    "version": {
      "description": "If `true`, returns the document version as part of a hit.",
      "allOf": [
        {
          "$ref": "#/$defs/_types.VersionNumber"
        }
      ]
    },
    "version_type": {
      "description": "Specific version type.\n\nSupported values include:\n  - `internal`: Use internal versioning that starts at 1 and increments with each update or delete.\n  - `external`: Only index the document if the specified version is strictly higher than the version of the stored document or if there is no existing document.\n  - `external_gte`: Only index the document if the specified version is equal or higher than the version of the stored document or if there is no existing document.\nNOTE: The `external_gte` version type is meant for special use cases and should be used with care.\nIf used incorrectly, it can result in loss of data.\n\n",
      "allOf": [
        {
          "$ref": "#/$defs/_types.VersionType"
        }
      ]
    }
  },
  "$defs": {
    "_global.termvectors.Filter": {
      "type": "object",
      "properties": {
        "max_doc_freq": {
          "description": "Ignore words which occur in more than this many docs.\nDefaults to unbounded.",
          "type": "number"
        },
        "max_num_terms": {
          "description": "The maximum number of terms that must be returned per field.",
          "default": 25.0,
          "type": "number"
        },
        "max_term_freq": {
          "description": "Ignore words with more than this frequency in the source doc.\nIt defaults to unbounded.",
          "type": "number"
        },
        "max_word_length": {
          "description": "The maximum word length above which words will be ignored.\nDefaults to unbounded.",
          "default": 0.0,
          "type": "number"
        },
        "min_doc_freq": {
          "description": "Ignore terms which do not occur in at least this many docs.",
          "default": 1.0,
          "type": "number"
        },
        "min_term_freq": {
          "description": "Ignore words with less than this frequency in the source doc.",
          "default": 1.0,
          "type": "number"
        },
        "min_word_length": {
          "description": "The minimum word length below which words will be ignored.",
          "default": 0.0,
          "type": "number"
        }
      }
    },
    "_types.Field": {
      "description": "Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.",
      "type": "string"
    },
    "_types.Fields": {
      "oneOf": [
        {
          "$ref": "#/$defs/_types.Field"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/_types.Field"
          }
        }
      ]
    },
    "_types.Id": {
      "type": "string"
    },
    "_types.IndexName": {
      "type": "string"
    },
    "_types.Routing": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "_types.VersionNumber": {
      "type": "number"
    },
    "_types.VersionType": {
      "type": "string",
      "enum": [
        "internal",
        "external",
        "external_gte"
      ]
    }
  }
}