Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add matrix and facets api examples #33

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,088 changes: 544 additions & 544 deletions fern/apis/master/openapi-overrides.yml

Large diffs are not rendered by default.

77 changes: 59 additions & 18 deletions fern/apis/master/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -5657,7 +5657,7 @@
"points"
],
"summary": "Search points matrix distance pairs",
"description": "Retrieve distance matrix with a pair based output format",
"description": "Compute distance matrix for sampled points with a pair based output format",
"operationId": "search_points_matrix_pairs",
"requestBody": {
"description": "Search matrix request with optional filtering",
Expand Down Expand Up @@ -5754,7 +5754,7 @@
"points"
],
"summary": "Search points matrix distance offsets",
"description": "Retrieve distance matrix with an offset based output format",
"description": "Compute distance matrix for sampled points with an offset based output format",
"operationId": "search_points_matrix_offsets",
"requestBody": {
"description": "Search matrix request with optional filtering",
Expand Down Expand Up @@ -5858,7 +5858,7 @@
],
"info": {
"title": "Qdrant API",
"description": "API description for Qdrant vector search engine.\n\nThis document describes CRUD and search operations on collections of points (vectors with payload).\n\nQdrant supports any combinations of `should`, `min_should`, `must` and `must_not` conditions, which makes it possible to use in applications when object could not be described solely by vector. It could be location features, availability flags, and other custom properties businesses should take into account.\n## Examples\nThis examples cover the most basic use-cases - collection creation and basic vector search.\n### Create collection\nFirst - let's create a collection with dot-production metric.\n```\ncurl -X PUT 'http://localhost:6333/collections/test_collection' \\\n -H 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"size\": 4,\n \"distance\": \"Dot\"\n }\n }'\n\n```\nExpected response:\n```\n{\n \"result\": true,\n \"status\": \"ok\",\n \"time\": 0.031095451\n}\n```\nWe can ensure that collection was created:\n```\ncurl 'http://localhost:6333/collections/test_collection'\n```\nExpected response:\n```\n{\n \"result\": {\n \"status\": \"green\",\n \"vectors_count\": 0,\n \"segments_count\": 5,\n \"disk_data_size\": 0,\n \"ram_data_size\": 0,\n \"config\": {\n \"params\": {\n \"vectors\": {\n \"size\": 4,\n \"distance\": \"Dot\"\n }\n },\n \"hnsw_config\": {\n \"m\": 16,\n \"ef_construct\": 100,\n \"full_scan_threshold\": 10000\n },\n \"optimizer_config\": {\n \"deleted_threshold\": 0.2,\n \"vacuum_min_vector_number\": 1000,\n \"max_segment_number\": 5,\n \"memmap_threshold\": 50000,\n \"indexing_threshold\": 20000,\n \"flush_interval_sec\": 1\n },\n \"wal_config\": {\n \"wal_capacity_mb\": 32,\n \"wal_segments_ahead\": 0\n }\n }\n },\n \"status\": \"ok\",\n \"time\": 2.1199e-05\n}\n```\n\n### Add points\nLet's now add vectors with some payload:\n```\ncurl -L -X PUT 'http://localhost:6333/collections/test_collection/points?wait=true' \\ -H 'Content-Type: application/json' \\ --data-raw '{\n \"points\": [\n {\"id\": 1, \"vector\": [0.05, 0.61, 0.76, 0.74], \"payload\": {\"city\": \"Berlin\"}},\n {\"id\": 2, \"vector\": [0.19, 0.81, 0.75, 0.11], \"payload\": {\"city\": [\"Berlin\", \"London\"] }},\n {\"id\": 3, \"vector\": [0.36, 0.55, 0.47, 0.94], \"payload\": {\"city\": [\"Berlin\", \"Moscow\"] }},\n {\"id\": 4, \"vector\": [0.18, 0.01, 0.85, 0.80], \"payload\": {\"city\": [\"London\", \"Moscow\"] }},\n {\"id\": 5, \"vector\": [0.24, 0.18, 0.22, 0.44], \"payload\": {\"count\": [0]}},\n {\"id\": 6, \"vector\": [0.35, 0.08, 0.11, 0.44]}\n ]\n}'\n```\nExpected response:\n```\n{\n \"result\": {\n \"operation_id\": 0,\n \"status\": \"completed\"\n },\n \"status\": \"ok\",\n \"time\": 0.000206061\n}\n```\n### Search with filtering\nLet's start with a basic request:\n```\ncurl -L -X POST 'http://localhost:6333/collections/test_collection/points/search' \\ -H 'Content-Type: application/json' \\ --data-raw '{\n \"vector\": [0.2,0.1,0.9,0.7],\n \"top\": 3\n}'\n```\nExpected response:\n```\n{\n \"result\": [\n { \"id\": 4, \"score\": 1.362, \"payload\": null, \"version\": 0 },\n { \"id\": 1, \"score\": 1.273, \"payload\": null, \"version\": 0 },\n { \"id\": 3, \"score\": 1.208, \"payload\": null, \"version\": 0 }\n ],\n \"status\": \"ok\",\n \"time\": 0.000055785\n}\n```\nBut result is different if we add a filter:\n```\ncurl -L -X POST 'http://localhost:6333/collections/test_collection/points/search' \\ -H 'Content-Type: application/json' \\ --data-raw '{\n \"filter\": {\n \"should\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"vector\": [0.2, 0.1, 0.9, 0.7],\n \"top\": 3\n}'\n```\nExpected response:\n```\n{\n \"result\": [\n { \"id\": 4, \"score\": 1.362, \"payload\": null, \"version\": 0 },\n { \"id\": 2, \"score\": 0.871, \"payload\": null, \"version\": 0 }\n ],\n \"status\": \"ok\",\n \"time\": 0.000093972\n}\n```\n",
"description": "API description for Qdrant vector search engine.\n\nThis document describes CRUD and search operations on collections of points (vectors with payload).\n\nQdrant supports any combinations of `should`, `min_should`, `must` and `must_not` conditions, which makes it possible to use in applications when object could not be described solely by vector. It could be location features, availability flags, and other custom properties businesses should take into account.\n## Examples\nThis examples cover the most basic use-cases - collection creation and basic vector search.\n### Create collection\nFirst - let's create a collection with dot-production metric.\n```\ncurl -X PUT 'http://localhost:6333/collections/test_collection' \\\n -H 'Content-Type: application/json' \\\n --data-raw '{\n \"vectors\": {\n \"size\": 4,\n \"distance\": \"Dot\"\n }\n }'\n\n```\nExpected response:\n```\n{\n \"result\": true,\n \"status\": \"ok\",\n \"time\": 0.031095451\n}\n```\nWe can ensure that collection was created:\n```\ncurl 'http://localhost:6333/collections/test_collection'\n```\nExpected response:\n```\n{\n \"result\": {\n \"status\": \"green\",\n \"vectors_count\": 0,\n \"segments_count\": 5,\n \"disk_data_size\": 0,\n \"ram_data_size\": 0,\n \"config\": {\n \"params\": {\n \"vectors\": {\n \"size\": 4,\n \"distance\": \"Dot\"\n }\n },\n \"hnsw_config\": {\n \"m\": 16,\n \"ef_construct\": 100,\n \"full_scan_threshold\": 10000\n },\n \"optimizer_config\": {\n \"deleted_threshold\": 0.2,\n \"vacuum_min_vector_number\": 1000,\n \"default_segment_number\": 2,\n \"max_segment_size\": null,\n \"memmap_threshold\": null,\n \"indexing_threshold\": 20000,\n \"flush_interval_sec\": 5,\n \"max_optimization_threads\": null\n },\n \"wal_config\": {\n \"wal_capacity_mb\": 32,\n \"wal_segments_ahead\": 0\n }\n }\n },\n \"status\": \"ok\",\n \"time\": 2.1199e-05\n}\n```\n\n### Add points\nLet's now add vectors with some payload:\n```\ncurl -L -X PUT 'http://localhost:6333/collections/test_collection/points?wait=true' \\ -H 'Content-Type: application/json' \\ --data-raw '{\n \"points\": [\n {\"id\": 1, \"vector\": [0.05, 0.61, 0.76, 0.74], \"payload\": {\"city\": \"Berlin\"}},\n {\"id\": 2, \"vector\": [0.19, 0.81, 0.75, 0.11], \"payload\": {\"city\": [\"Berlin\", \"London\"] }},\n {\"id\": 3, \"vector\": [0.36, 0.55, 0.47, 0.94], \"payload\": {\"city\": [\"Berlin\", \"Moscow\"] }},\n {\"id\": 4, \"vector\": [0.18, 0.01, 0.85, 0.80], \"payload\": {\"city\": [\"London\", \"Moscow\"] }},\n {\"id\": 5, \"vector\": [0.24, 0.18, 0.22, 0.44], \"payload\": {\"count\": [0]}},\n {\"id\": 6, \"vector\": [0.35, 0.08, 0.11, 0.44]}\n ]\n}'\n```\nExpected response:\n```\n{\n \"result\": {\n \"operation_id\": 0,\n \"status\": \"completed\"\n },\n \"status\": \"ok\",\n \"time\": 0.000206061\n}\n```\n### Search with filtering\nLet's start with a basic request:\n```\ncurl -L -X POST 'http://localhost:6333/collections/test_collection/points/search' \\ -H 'Content-Type: application/json' \\ --data-raw '{\n \"vector\": [0.2,0.1,0.9,0.7],\n \"top\": 3\n}'\n```\nExpected response:\n```\n{\n \"result\": [\n { \"id\": 4, \"score\": 1.362, \"payload\": null, \"version\": 0 },\n { \"id\": 1, \"score\": 1.273, \"payload\": null, \"version\": 0 },\n { \"id\": 3, \"score\": 1.208, \"payload\": null, \"version\": 0 }\n ],\n \"status\": \"ok\",\n \"time\": 0.000055785\n}\n```\nBut result is different if we add a filter:\n```\ncurl -L -X POST 'http://localhost:6333/collections/test_collection/points/search' \\ -H 'Content-Type: application/json' \\ --data-raw '{\n \"filter\": {\n \"should\": [\n {\n \"key\": \"city\",\n \"match\": {\n \"value\": \"London\"\n }\n }\n ]\n },\n \"vector\": [0.2, 0.1, 0.9, 0.7],\n \"top\": 3\n}'\n```\nExpected response:\n```\n{\n \"result\": [\n { \"id\": 4, \"score\": 1.362, \"payload\": null, \"version\": 0 },\n { \"id\": 2, \"score\": 0.871, \"payload\": null, \"version\": 0 }\n ],\n \"status\": \"ok\",\n \"time\": 0.000093972\n}\n```\n",
"contact": {
"email": "[email protected]"
},
Expand Down Expand Up @@ -6053,7 +6053,7 @@
}
},
"CollectionStatus": {
"description": "Current state of the collection. `Green` - all good. `Yellow` - optimization is running, `Red` - some operations failed and was not recovered",
"description": "Current state of the collection. `Green` - all good. `Yellow` - optimization is running, 'Grey' - optimizations are possible but not triggered, `Red` - some operations failed and was not recovered",
"type": "string",
"enum": [
"green",
Expand Down Expand Up @@ -6854,12 +6854,14 @@
"$ref": "#/components/schemas/TokenizerType"
},
"min_token_len": {
"description": "Minimum characters to be tokenized.",
"type": "integer",
"format": "uint",
"minimum": 0,
"nullable": true
},
"max_token_len": {
"description": "Maximum characters to be tokenized.",
"type": "integer",
"format": "uint",
"minimum": 0,
Expand All @@ -6869,6 +6871,11 @@
"description": "If true, lowercase all tokens. Default: true.",
"type": "boolean",
"nullable": true
},
"on_disk": {
"description": "If true, store the index on disk. Default: false.",
"type": "boolean",
"nullable": true
}
}
},
Expand Down Expand Up @@ -9705,7 +9712,6 @@
"local_shards",
"peer_id",
"remote_shards",
"resharding_operations",
"shard_count",
"shard_transfers"
],
Expand Down Expand Up @@ -9748,7 +9754,8 @@
"type": "array",
"items": {
"$ref": "#/components/schemas/ReshardingInfo"
}
},
"nullable": true
}
}
},
Expand Down Expand Up @@ -10032,6 +10039,10 @@
"type": "boolean",
"nullable": true
},
"hide_jwt_dashboard": {
"type": "boolean",
"nullable": true
},
"startup": {
"type": "string",
"format": "date-time"
Expand Down Expand Up @@ -10215,13 +10226,30 @@
"type": "object",
"required": [
"optimizations",
"segments"
"segments",
"total_optimized_points"
],
"properties": {
"variant_name": {
"type": "string",
"nullable": true
},
"status": {
"anyOf": [
{
"$ref": "#/components/schemas/ShardStatus"
},
{
"nullable": true
}
]
},
"total_optimized_points": {
"description": "Total number of optimized points since the last start.",
"type": "integer",
"format": "uint",
"minimum": 0
},
"segments": {
"type": "array",
"items": {
Expand All @@ -10233,6 +10261,16 @@
}
}
},
"ShardStatus": {
"description": "Current state of the shard (supports same states as the collection) `Green` - all good. `Yellow` - optimization is running, 'Grey' - optimizations are possible but not triggered, `Red` - some operations failed and was not recovered",
"type": "string",
"enum": [
"green",
"yellow",
"grey",
"red"
]
},
"SegmentTelemetry": {
"type": "object",
"required": [
Expand Down Expand Up @@ -10936,6 +10974,11 @@
"$ref": "#/components/schemas/PeerInfo"
},
"nullable": true
},
"metadata": {
"type": "object",
"additionalProperties": true,
"nullable": true
}
}
},
Expand Down Expand Up @@ -12983,10 +13026,6 @@
},
"SearchMatrixRequest": {
"type": "object",
"required": [
"limit",
"sample"
],
"properties": {
"shard_key": {
"description": "Specify in which shards to look for the points, if not specified - look in all shards",
Expand All @@ -13011,16 +13050,18 @@
]
},
"sample": {
"description": "How many points to select and search within.",
"description": "How many points to select and search within. Default is 10.",
"type": "integer",
"format": "uint",
"minimum": 2
"minimum": 2,
"nullable": true
},
"limit": {
"description": "How many neighbours per sample to find",
"description": "How many neighbours per sample to find. Default is 3.",
"type": "integer",
"format": "uint",
"minimum": 1
"minimum": 1,
"nullable": true
},
"using": {
"description": "Define which vector name to use for querying. If missing, the default vector is used.",
Expand All @@ -13039,7 +13080,7 @@
],
"properties": {
"offsets_row": {
"description": "Row coordinates of the CRS matrix",
"description": "Row indices of the matrix",
"type": "array",
"items": {
"type": "integer",
Expand All @@ -13048,7 +13089,7 @@
}
},
"offsets_col": {
"description": "Column coordinates ids of the matrix",
"description": "Column indices of the matrix",
"type": "array",
"items": {
"type": "integer",
Expand All @@ -13057,7 +13098,7 @@
}
},
"scores": {
"description": "Scores associate with coordinates",
"description": "Scores associated with matrix coordinates",
"type": "array",
"items": {
"type": "number",
Expand Down
Loading