Files
qdrant/openapi/models.json
2021-01-25 00:13:37 +01:00

1271 lines
49 KiB
JSON

{
"components": {
"schemas": {
"AliasOperations": {
"anyOf": [
{
"description": "Create alternative name for a collection. Collection will be available under both names for search, retrieve,",
"type": "object",
"required": [
"create_alias"
],
"properties": {
"create_alias": {
"type": "object",
"required": [
"alias_name",
"collection_name"
],
"properties": {
"alias_name": {
"type": "string"
},
"collection_name": {
"type": "string"
}
}
}
}
},
{
"description": "Delete alias if exists",
"type": "object",
"required": [
"delete_alias"
],
"properties": {
"delete_alias": {
"type": "object",
"required": [
"alias_name"
],
"properties": {
"alias_name": {
"type": "string"
}
}
}
}
},
{
"description": "Change alias to a new one",
"type": "object",
"required": [
"rename_alias"
],
"properties": {
"rename_alias": {
"type": "object",
"required": [
"new_alias_name",
"old_alias_name"
],
"properties": {
"new_alias_name": {
"type": "string"
},
"old_alias_name": {
"type": "string"
}
}
}
}
}
]
},
"CollectionDescription": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
}
},
"CollectionInfo": {
"description": "Current statistics and configuration of the collection.",
"type": "object",
"required": [
"config",
"disk_data_size",
"ram_data_size",
"segments_count",
"vectors_count"
],
"properties": {
"config": {
"$ref": "#/components/schemas/SegmentConfig"
},
"disk_data_size": {
"description": "Disk space, used by collection",
"type": "integer",
"format": "uint",
"minimum": 0
},
"ram_data_size": {
"description": "RAM used by collection",
"type": "integer",
"format": "uint",
"minimum": 0
},
"segments_count": {
"description": "Number of segments in collection",
"type": "integer",
"format": "uint",
"minimum": 0
},
"vectors_count": {
"description": "Number of vectors in collection",
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"CollectionUpdateOperations": {
"anyOf": [
{
"$ref": "#/components/schemas/PointOps"
},
{
"$ref": "#/components/schemas/PayloadOps"
}
]
},
"CollectionsResponse": {
"type": "object",
"required": [
"collections"
],
"properties": {
"collections": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CollectionDescription"
}
}
}
},
"Condition": {
"anyOf": [
{
"description": "Nested filter",
"type": "object",
"required": [
"filter"
],
"properties": {
"filter": {
"$ref": "#/components/schemas/Filter"
}
}
},
{
"description": "Check if point has field with a given value",
"type": "object",
"required": [
"match"
],
"properties": {
"match": {
"$ref": "#/components/schemas/Match"
}
}
},
{
"description": "Check if points value lies in a given range",
"type": "object",
"required": [
"range"
],
"properties": {
"range": {
"$ref": "#/components/schemas/Range"
}
}
},
{
"description": "Check if points geo location lies in a given area",
"type": "object",
"required": [
"geo_bounding_box"
],
"properties": {
"geo_bounding_box": {
"$ref": "#/components/schemas/GeoBoundingBox"
}
}
},
{
"description": "Check if geo point is within a given radius",
"type": "object",
"required": [
"geo_radius"
],
"properties": {
"geo_radius": {
"$ref": "#/components/schemas/GeoRadius"
}
}
},
{
"description": "Check if points id is in a given set",
"type": "object",
"required": [
"has_id"
],
"properties": {
"has_id": {
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
}
}
}
]
},
"Distance": {
"description": "Type of internal tags, build from payload Distance function types used to compare vectors",
"type": "string",
"enum": [
"Cosine",
"Euclid",
"Dot"
]
},
"Filter": {
"type": "object",
"properties": {
"must": {
"description": "All conditions must match",
"type": "array",
"items": {
"$ref": "#/components/schemas/Condition"
},
"nullable": true
},
"must_not": {
"description": "All conditions must NOT match",
"type": "array",
"items": {
"$ref": "#/components/schemas/Condition"
},
"nullable": true
},
"should": {
"description": "At least one of thous conditions should match",
"type": "array",
"items": {
"$ref": "#/components/schemas/Condition"
},
"nullable": true
}
}
},
"GeoBoundingBox": {
"type": "object",
"required": [
"bottom_right",
"key",
"top_left"
],
"properties": {
"bottom_right": {
"$ref": "#/components/schemas/GeoPoint"
},
"key": {
"description": "Name of the field to match with",
"type": "string"
},
"top_left": {
"$ref": "#/components/schemas/GeoPoint"
}
}
},
"GeoPoint": {
"type": "object",
"required": [
"lat",
"lon"
],
"properties": {
"lat": {
"type": "number",
"format": "double"
},
"lon": {
"type": "number",
"format": "double"
}
}
},
"GeoRadius": {
"type": "object",
"required": [
"center",
"key",
"radius"
],
"properties": {
"center": {
"$ref": "#/components/schemas/GeoPoint"
},
"key": {
"description": "Name of the field to match with",
"type": "string"
},
"radius": {
"description": "Radius of the area in meters",
"type": "number",
"format": "double"
}
}
},
"Indexes": {
"anyOf": [
{
"description": "Do not use any index, scan whole vector collection during search. Guarantee 100% precision, but may be time consuming on large collections.",
"type": "object",
"required": [
"options",
"type"
],
"properties": {
"options": {
"type": "object"
},
"type": {
"type": "string",
"enum": [
"plain"
]
}
}
},
{
"description": "Use filterable HNSW index for approximate search. Is very fast even on a very huge collections, but require additional space to store index and additional time to build it.",
"type": "object",
"required": [
"options",
"type"
],
"properties": {
"options": {
"type": "object",
"required": [
"ef_construct",
"m"
],
"properties": {
"ef_construct": {
"description": "Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build index.",
"type": "integer",
"format": "uint",
"minimum": 0
},
"m": {
"description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.",
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"type": {
"type": "string",
"enum": [
"hnsw"
]
}
}
}
]
},
"Match": {
"type": "object",
"required": [
"key"
],
"properties": {
"integer": {
"description": "Integer value to match",
"type": "integer",
"format": "int64",
"nullable": true
},
"key": {
"description": "Name of the field to match with",
"type": "string"
},
"keyword": {
"description": "Keyword value to match",
"type": "string",
"nullable": true
}
}
},
"PayloadInterface": {
"anyOf": [
{
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"keyword"
]
},
"value": {
"$ref": "#/components/schemas/PayloadVariant_for_String"
}
}
},
{
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"integer"
]
},
"value": {
"$ref": "#/components/schemas/PayloadVariant_for_int64"
}
}
},
{
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"float"
]
},
"value": {
"$ref": "#/components/schemas/PayloadVariant_for_double"
}
}
},
{
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"geo"
]
},
"value": {
"$ref": "#/components/schemas/PayloadVariant_for_GeoPoint"
}
}
}
]
},
"PayloadOps": {
"description": "Define operations description for point payloads manipulation",
"anyOf": [
{
"description": "Set payload value, overrides if it is already exists",
"type": "object",
"required": [
"set_payload"
],
"properties": {
"set_payload": {
"type": "object",
"required": [
"payload",
"points"
],
"properties": {
"payload": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/PayloadInterface"
}
},
"points": {
"description": "Assigns payload to each point in this list",
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
}
}
}
}
},
{
"description": "Deletes specified payload values if they are assigned",
"type": "object",
"required": [
"delete_payload"
],
"properties": {
"delete_payload": {
"type": "object",
"required": [
"keys",
"points"
],
"properties": {
"keys": {
"type": "array",
"items": {
"type": "string"
}
},
"points": {
"description": "Deletes values from each point in this list",
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
}
}
}
}
},
{
"description": "Drops all Payload values associated with given points.",
"type": "object",
"required": [
"clear_payload"
],
"properties": {
"clear_payload": {
"type": "object",
"required": [
"points"
],
"properties": {
"points": {
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
}
}
}
}
}
]
},
"PayloadType": {
"anyOf": [
{
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"keyword"
]
},
"value": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
{
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"integer"
]
},
"value": {
"type": "array",
"items": {
"type": "integer",
"format": "int64"
}
}
}
},
{
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"float"
]
},
"value": {
"type": "array",
"items": {
"type": "number",
"format": "double"
}
}
}
},
{
"type": "object",
"required": [
"type",
"value"
],
"properties": {
"type": {
"type": "string",
"enum": [
"geo"
]
},
"value": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GeoPoint"
}
}
}
}
]
},
"PayloadVariant_for_GeoPoint": {
"anyOf": [
{
"$ref": "#/components/schemas/GeoPoint"
},
{
"type": "array",
"items": {
"$ref": "#/components/schemas/GeoPoint"
}
}
]
},
"PayloadVariant_for_String": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"PayloadVariant_for_double": {
"anyOf": [
{
"type": "number",
"format": "double"
},
{
"type": "array",
"items": {
"type": "number",
"format": "double"
}
}
]
},
"PayloadVariant_for_int64": {
"anyOf": [
{
"type": "integer",
"format": "int64"
},
{
"type": "array",
"items": {
"type": "integer",
"format": "int64"
}
}
]
},
"PointInsertOps": {
"anyOf": [
{
"description": "Inset points from a batch.",
"type": "object",
"required": [
"batch"
],
"properties": {
"batch": {
"type": "object",
"required": [
"ids",
"vectors"
],
"properties": {
"ids": {
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
},
"payloads": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/PayloadInterface"
},
"nullable": true
},
"nullable": true
},
"vectors": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "number",
"format": "float"
}
}
}
}
}
}
},
{
"description": "Insert points from a list",
"type": "object",
"required": [
"points"
],
"properties": {
"points": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PointStruct"
}
}
}
}
]
},
"PointOps": {
"anyOf": [
{
"description": "Insert or update points",
"type": "object",
"required": [
"upsert_points"
],
"properties": {
"upsert_points": {
"$ref": "#/components/schemas/PointInsertOps"
}
}
},
{
"description": "Delete point if exists",
"type": "object",
"required": [
"delete_points"
],
"properties": {
"delete_points": {
"type": "object",
"required": [
"ids"
],
"properties": {
"ids": {
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
}
}
}
}
}
]
},
"PointRequest": {
"type": "object",
"required": [
"ids"
],
"properties": {
"ids": {
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
}
}
},
"PointStruct": {
"type": "object",
"required": [
"id",
"vector"
],
"properties": {
"id": {
"description": "Point id",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"payload": {
"description": "Payload values (optional)",
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/PayloadInterface"
},
"nullable": true
},
"vector": {
"description": "Vector",
"type": "array",
"items": {
"type": "number",
"format": "float"
}
}
}
},
"Range": {
"type": "object",
"required": [
"key"
],
"properties": {
"gt": {
"description": "point.key > range.gt",
"type": "number",
"format": "double",
"nullable": true
},
"gte": {
"description": "point.key >= range.gte",
"type": "number",
"format": "double",
"nullable": true
},
"key": {
"description": "Name of the field to match with",
"type": "string"
},
"lt": {
"description": "point.key < range.lt",
"type": "number",
"format": "double",
"nullable": true
},
"lte": {
"description": "point.key <= range.lte",
"type": "number",
"format": "double",
"nullable": true
}
}
},
"RecommendRequest": {
"description": "Search request",
"type": "object",
"required": [
"negative",
"positive",
"top"
],
"properties": {
"filter": {
"description": "Look only for points which satisfies this conditions",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"negative": {
"description": "Try to avoid vectors like this",
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
},
"params": {
"description": "Additional search params",
"anyOf": [
{
"$ref": "#/components/schemas/SearchParams"
},
{
"nullable": true
}
]
},
"positive": {
"description": "Look for vectors closest to those",
"type": "array",
"items": {
"type": "integer",
"format": "uint64",
"minimum": 0
}
},
"top": {
"description": "Max number of result to return",
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"Record": {
"description": "Point data",
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"description": "Id of the point",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"payload": {
"description": "Payload - values assigned to the point",
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/PayloadType"
},
"nullable": true
},
"vector": {
"description": "Vector of the point",
"type": "array",
"items": {
"type": "number",
"format": "float"
},
"nullable": true
}
}
},
"ScoredPoint": {
"type": "object",
"required": [
"id",
"score"
],
"properties": {
"id": {
"description": "Point id",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"score": {
"description": "Points vector distance to the query vector",
"type": "number",
"format": "float"
}
}
},
"SearchParams": {
"description": "Additional parameters of the search",
"anyOf": [
{
"description": "Params relevant to HNSW index",
"type": "object",
"required": [
"hnsw"
],
"properties": {
"hnsw": {
"type": "object",
"required": [
"ef"
],
"properties": {
"ef": {
"description": "Size of the beam in a beam-search. Larger the value - more accurate the result, more time required for search.",
"type": "integer",
"format": "uint",
"minimum": 0
}
}
}
}
}
]
},
"SearchRequest": {
"description": "Search request",
"type": "object",
"required": [
"top",
"vector"
],
"properties": {
"filter": {
"description": "Look only for points which satisfies this conditions",
"anyOf": [
{
"$ref": "#/components/schemas/Filter"
},
{
"nullable": true
}
]
},
"params": {
"description": "Additional search params",
"anyOf": [
{
"$ref": "#/components/schemas/SearchParams"
},
{
"nullable": true
}
]
},
"top": {
"description": "Max number of result to return",
"type": "integer",
"format": "uint",
"minimum": 0
},
"vector": {
"description": "Look for vectors closest to this",
"type": "array",
"items": {
"type": "number",
"format": "float"
}
}
}
},
"SegmentConfig": {
"type": "object",
"required": [
"distance",
"index",
"storage_type",
"vector_size"
],
"properties": {
"distance": {
"$ref": "#/components/schemas/Distance"
},
"index": {
"$ref": "#/components/schemas/Indexes"
},
"storage_type": {
"$ref": "#/components/schemas/StorageType"
},
"vector_size": {
"description": "Size of a vectors used",
"type": "integer",
"format": "uint",
"minimum": 0
}
}
},
"StorageOps": {
"anyOf": [
{
"description": "Create new collection and (optionally) specify index params",
"type": "object",
"required": [
"create_collection"
],
"properties": {
"create_collection": {
"type": "object",
"required": [
"distance",
"name",
"vector_size"
],
"properties": {
"distance": {
"$ref": "#/components/schemas/Distance"
},
"index": {
"anyOf": [
{
"$ref": "#/components/schemas/Indexes"
},
{
"nullable": true
}
]
},
"name": {
"type": "string"
},
"vector_size": {
"type": "integer",
"format": "uint",
"minimum": 0
}
}
}
}
},
{
"description": "Delete collection with given name",
"type": "object",
"required": [
"delete_collection"
],
"properties": {
"delete_collection": {
"type": "string"
}
}
},
{
"description": "Perform changes of collection aliases Alias changes are atomic, meaning that no collection modifications can happen between alias operations",
"type": "object",
"required": [
"change_aliases"
],
"properties": {
"change_aliases": {
"type": "object",
"required": [
"actions"
],
"properties": {
"actions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/AliasOperations"
}
}
}
}
}
}
]
},
"StorageType": {
"description": "Type of vector storage",
"anyOf": [
{
"description": "Store vectors in memory and use persistence storage only if vectors are changed",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"in_memory"
]
}
}
},
{
"description": "Use memmap to store vectors, a little slower than `InMemory`, but requires little RAM",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"mmap"
]
}
}
}
]
},
"UpdateResult": {
"type": "object",
"required": [
"operation_id",
"status"
],
"properties": {
"operation_id": {
"description": "Sequential number of the operation",
"type": "integer",
"format": "uint64",
"minimum": 0
},
"status": {
"$ref": "#/components/schemas/UpdateStatus"
}
}
},
"UpdateStatus": {
"type": "string",
"enum": [
"acknowledged",
"completed"
]
}
}
}
}