From a869128a2a9fb3efb8fc641198ce78cf1384af0a Mon Sep 17 00:00:00 2001 From: Anush Date: Thu, 31 Oct 2024 05:56:39 +0530 Subject: [PATCH] docs: Proofread Python snippets (#1255) * docs: Proofread Python snippets Signed-off-by: Anush008 * docs: Fix index Signed-off-by: Anush008 * remove redundant comment Signed-off-by: Anush008 * Update configuration.md * docs: fix typo filtering.md * Update datadog.md --------- Signed-off-by: Anush008 --- .../documentation/concepts/collections.md | 2 +- .../content/documentation/concepts/explore.md | 12 ++++++++ .../documentation/concepts/filtering.md | 2 +- .../documentation/concepts/hybrid-queries.md | 30 +++++++++---------- .../documentation/concepts/indexing.md | 14 ++++----- .../content/documentation/concepts/points.md | 7 ----- .../content/documentation/concepts/vectors.md | 21 +++++++------ .../documentation/guides/configuration.md | 6 ++-- .../documentation/observability/datadog.md | 2 +- 9 files changed, 50 insertions(+), 46 deletions(-) diff --git a/qdrant-landing/content/documentation/concepts/collections.md b/qdrant-landing/content/documentation/concepts/collections.md index 873f8917b..b5ca5a4ef 100644 --- a/qdrant-landing/content/documentation/concepts/collections.md +++ b/qdrant-landing/content/documentation/concepts/collections.md @@ -200,7 +200,7 @@ curl -X PUT http://localhost:6333/collections/{collection_name} \ ``` ```python -from qdrant_client import QdrantClient +from qdrant_client import QdrantClient, models client = QdrantClient(url="http://localhost:6333") diff --git a/qdrant-landing/content/documentation/concepts/explore.md b/qdrant-landing/content/documentation/concepts/explore.md index eb245c69e..5a45ea125 100644 --- a/qdrant-landing/content/documentation/concepts/explore.md +++ b/qdrant-landing/content/documentation/concepts/explore.md @@ -980,6 +980,10 @@ discover_queries = [ limit=10, ), ] + +client.query_batch_points( + collection_name="{collection_name}", requests=discover_queries +) ``` ```typescript @@ -1189,6 +1193,10 @@ discover_queries = [ limit=10, ), ] + +client.query_batch_points( + collection_name="{collection_name}", requests=discover_queries +) ``` ```typescript @@ -1367,6 +1375,8 @@ POST /collections/{collection_name}/points/search/matrix/pairs ```python from qdrant_client import QdrantClient, models +client = QdrantClient(url="http://localhost:6333") + client.search_matrix_pairs( collection_name="{collection_name}", sample=10, @@ -1533,6 +1543,8 @@ POST /collections/{collection_name}/points/search/matrix/offsets ```python from qdrant_client import QdrantClient, models +client = QdrantClient(url="http://localhost:6333") + client.search_matrix_offsets( collection_name="{collection_name}", sample=10, diff --git a/qdrant-landing/content/documentation/concepts/filtering.md b/qdrant-landing/content/documentation/concepts/filtering.md index 2c03ac1c6..c5501341a 100644 --- a/qdrant-landing/content/documentation/concepts/filtering.md +++ b/qdrant-landing/content/documentation/concepts/filtering.md @@ -449,7 +449,7 @@ Filtered points would be: ] ``` -When using `must_not`, the clause becomes `true` if none if the conditions listed inside `should` is satisfied. +When using `must_not`, the clause becomes `true` if none of the conditions listed inside `should` is satisfied. In this sense, `must_not` is equivalent to the expression `(NOT A) AND (NOT B) AND (NOT C)`. ### Clauses combination diff --git a/qdrant-landing/content/documentation/concepts/hybrid-queries.md b/qdrant-landing/content/documentation/concepts/hybrid-queries.md index 075ec851f..012f5c9c5 100644 --- a/qdrant-landing/content/documentation/concepts/hybrid-queries.md +++ b/qdrant-landing/content/documentation/concepts/hybrid-queries.md @@ -89,7 +89,7 @@ client.query_points( limit=20, ), models.Prefetch( - query=[0.01, 0.45, 0.67, ...], # <-- dense vector + query=[0.01, 0.45, 0.67], # <-- dense vector using="dense", limit=20, ), @@ -284,7 +284,7 @@ client.query_points( using="mrl_byte", limit=1000, ), - query=[0.01, 0.299, 0.45, 0.67, ...], # <-- full vector + query=[0.01, 0.299, 0.45, 0.67], # <-- full vector using="full", limit=10, ) @@ -428,13 +428,13 @@ client = QdrantClient(url="http://localhost:6333") client.query_points( collection_name="{collection_name}", prefetch=models.Prefetch( - query=[0.01, 0.45, 0.67, ...], # <-- dense vector + query=[0.01, 0.45, 0.67, 0.53], # <-- dense vector limit=100, ), query=[ - [0.1, 0.2, ...], # <─┐ - [0.2, 0.1, ...], # < ├─ multi-vector - [0.8, 0.9, ...], # < ┘ + [0.1, 0.2, 0.32], # <─┐ + [0.2, 0.1, 0.52], # < ├─ multi-vector + [0.8, 0.9, 0.93], # < ┘ ], using="colbert", limit=10, @@ -608,14 +608,14 @@ client.query_points( using="mrl_byte", limit=1000, ), - query=[0.01, 0.45, 0.67, ...], # <-- full dense vector + query=[0.01, 0.45, 0.67], # <-- full dense vector using="full", limit=100, ), query=[ - [0.1, 0.2, ...], # <─┐ - [0.2, 0.1, ...], # < ├─ multi-vector - [0.8, 0.9, ...], # < ┘ + [0.17, 0.23, 0.52], # <─┐ + [0.22, 0.11, 0.63], # < ├─ multi-vector + [0.86, 0.93, 0.12], # < ┘ ], using="colbert", limit=10, @@ -913,7 +913,7 @@ client.query_points( collection_name="{collection_name}", query="43cf51e2-8777-4f52-bc74-c2cbde0c8b04", # <--- point id using="512d-vector", - lookup_from=models.LookupFrom( + lookup_from=models.LookupLocation( collection="another_collection", # <--- other collection name vector="image-512", # <--- vector name in the other collection ) @@ -1079,21 +1079,21 @@ client.query_points( collection_name="{collection_name}", prefetch=[ models.Prefetch( - query=[0.01, 0.45, 0.67, ...], # <-- dense vector + query=[0.01, 0.45, 0.67], # <-- dense vector filter=models.Filter( must=models.FieldCondition( key="color", - match=models.Match(value="red"), + match=models.MatchValue(value="red"), ), ), limit=10, ), models.Prefetch( - query=[0.01, 0.45, 0.67, ...], # <-- dense vector + query=[0.01, 0.45, 0.67], # <-- dense vector filter=models.Filter( must=models.FieldCondition( key="color", - match=models.Match(value="green"), + match=models.MatchValue(value="green"), ), ), limit=10, diff --git a/qdrant-landing/content/documentation/concepts/indexing.md b/qdrant-landing/content/documentation/concepts/indexing.md index 758b00e07..721ab52be 100644 --- a/qdrant-landing/content/documentation/concepts/indexing.md +++ b/qdrant-landing/content/documentation/concepts/indexing.md @@ -41,7 +41,7 @@ client = QdrantClient(url="http://localhost:6333") client.create_payload_index( collection_name="{collection_name}", field_name="name_of_the_field_to_index", - field_schema="keyword", + field_schema=models.PayloadSchemaType.KEYWORD, ) ``` @@ -520,7 +520,7 @@ client.create_payload_index( collection_name="{collection_name}", field_name="payload_field_name", field_schema=models.KeywordIndexParams( - type="keyword", + type=models.KeywordIndexType.KEYWORD, on_disk=True, ), ) @@ -677,7 +677,7 @@ client.create_payload_index( collection_name="{collection_name}", field_name="payload_field_name", field_schema=models.KeywordIndexParams( - type="keyword", + type=models.KeywordIndexType.KEYWORD, is_tenant=True, ), ) @@ -814,8 +814,8 @@ PUT /collections/{collection_name}/index client.create_payload_index( collection_name="{collection_name}", field_name="timestamp", - field_schema=models.KeywordIndexParams( - type="integer", + field_schema=models.IntegerIndexParams( + type=models.IntegerIndexType.INTEGER, is_principal=True, ), ) @@ -834,7 +834,7 @@ client.createPayloadIndex("{collection_name}", { ```rust use qdrant_client::qdrant::{ CreateFieldIndexCollectionBuilder, - IntegerdIndexParamsBuilder, + IntegerIndexParamsBuilder, FieldType }; use qdrant_client::{Qdrant, QdrantError}; @@ -848,7 +848,7 @@ client.create_field_index( FieldType::Integer, ) .field_index_params( - IntegerdIndexParamsBuilder::default() + IntegerIndexParamsBuilder::default() .is_principal(true), ), ); diff --git a/qdrant-landing/content/documentation/concepts/points.md b/qdrant-landing/content/documentation/concepts/points.md index a24f78938..145c26c5f 100755 --- a/qdrant-landing/content/documentation/concepts/points.md +++ b/qdrant-landing/content/documentation/concepts/points.md @@ -1705,13 +1705,6 @@ REST API ([Schema](https://api.qdrant.tech/api-reference/points/get-point)): GET /collections/{collection_name}/points/{point_id} ``` - - ## Scroll points Sometimes it might be necessary to get all stored points without knowing ids, or iterate over points that correspond to a filter. diff --git a/qdrant-landing/content/documentation/concepts/vectors.md b/qdrant-landing/content/documentation/concepts/vectors.md index 069846aa5..275423a7d 100644 --- a/qdrant-landing/content/documentation/concepts/vectors.md +++ b/qdrant-landing/content/documentation/concepts/vectors.md @@ -108,6 +108,7 @@ client = QdrantClient(url="http://localhost:6333") client.create_collection( collection_name="{collection_name}", + vectors_config={}, sparse_vectors_config={ "text": models.SparseVectorParams(), }, @@ -380,7 +381,7 @@ client = QdrantClient(url="http://localhost:6333") result = client.query_points( collection_name="{collection_name}", - query_vector=models.SparseVector(indices=[1, 3, 5, 7], values=[0.1, 0.2, 0.3, 0.4]), + query=models.SparseVector(indices=[1, 3, 5, 7], values=[0.1, 0.2, 0.3, 0.4]), using="text", ).points ``` @@ -672,9 +673,9 @@ client.upsert( models.PointStruct( id=1, vector=[ - [-0.013, 0.020, -0.007, -0.111, ...], - [-0.030, -0.055, 0.001, 0.072, ...], - [-0.041, 0.014, -0.032, -0.062, ...] + [-0.013, 0.020, -0.007, -0.111], + [-0.030, -0.055, 0.001, 0.072], + [-0.041, 0.014, -0.032, -0.062] ], ) ], @@ -824,9 +825,9 @@ client = QdrantClient(url="http://localhost:6333") client.query_points( collection_name="{collection_name}", query=[ - [-0.013, 0.020, -0.007, -0.111, ...], - [-0.030, -0.055, 0.001, 0.072, ...], - [-0.041, 0.014, -0.032, -0.062, ...] + [-0.013, 0.020, -0.007, -0.111], + [-0.030, -0.055, 0.001, 0.072], + [-0.041, 0.014, -0.032, -0.062] ], ) ``` @@ -1598,13 +1599,11 @@ client = QdrantClient(url="http://localhost:6333") client.create_collection( collection_name="{collection_name}", vectors_config=models.VectorParams( - size=128, - distance=models.Distance.COSINE, - datatype=models.Datatype.UINT8 + size=128, distance=models.Distance.COSINE, datatype=models.Datatype.UINT8 ), sparse_vectors_config={ "text": models.SparseVectorParams( - index=models.SparseIndexConfig(datatype=models.Datatype.UINT8) + index=models.SparseIndexParams(datatype=models.Datatype.UINT8) ), }, ) diff --git a/qdrant-landing/content/documentation/guides/configuration.md b/qdrant-landing/content/documentation/guides/configuration.md index 657d593b1..c5a23db31 100644 --- a/qdrant-landing/content/documentation/guides/configuration.md +++ b/qdrant-landing/content/documentation/guides/configuration.md @@ -153,10 +153,10 @@ storage: # endpoint_url: "" # Where to store temporary files - # If null, temporary snapshot are stored in: storage/snapshots_temp/ + # If null, temporary snapshots are stored in: storage/snapshots_temp/ temp_path: null - # If true - point's payload will not be stored in memory. + # If true - the point's payload will not be stored in memory. # It will be read from the disk every time it is requested. # This setting saves RAM by (slightly) increasing the response time. # Note: those payload values that are involved in filtering and are indexed - remain in RAM. @@ -251,7 +251,7 @@ storage: # To enable memmap storage, lower the threshold # Note: 1Kb = 1 vector of size 256 # To explicitly disable mmap optimization, set to `0`. - # If not set, will be disabled by default. Previously this was calles memmap_threshold_kb. + # If not set, will be disabled by default. Previously this was called memmap_threshold_kb. memmap_threshold: null # Maximum size (in KiloBytes) of vectors allowed for plain index. diff --git a/qdrant-landing/content/documentation/observability/datadog.md b/qdrant-landing/content/documentation/observability/datadog.md index cc7ffe078..4b7c7b9f7 100644 --- a/qdrant-landing/content/documentation/observability/datadog.md +++ b/qdrant-landing/content/documentation/observability/datadog.md @@ -20,7 +20,7 @@ You can install the [Qdrant integration](https://docs.datadoghq.com/integrations datadog-agent integration install -t qdrant==1.0.0 ``` -- Edit the `qdrant.d/conf.yaml` file in the `conf.d/` folder at the root of your [Agent's configuration directory](https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory) to start collecting your [Qdrant metrics](/documentation/guides/monitoring/). +- Edit the `conf.d/qdrant.d/conf.yaml` file in your [Agent's configuration directory](https://docs.datadoghq.com/agent/guide/agent-configuration-files/#agent-configuration-directory) to start collecting your [Qdrant metrics](/documentation/guides/monitoring/). Most importantly, set the `openmetrics_endpoint` value to the `/metrics` endpoint of your Qdrant instance.