Skip to content

Commit

Permalink
docs: Proofread Python snippets (#1255)
Browse files Browse the repository at this point in the history
* docs: Proofread Python snippets

Signed-off-by: Anush008 <[email protected]>

* docs: Fix index

Signed-off-by: Anush008 <[email protected]>

* remove redundant comment

Signed-off-by: Anush008 <[email protected]>

* Update configuration.md

* docs: fix typo filtering.md

* Update datadog.md

---------

Signed-off-by: Anush008 <[email protected]>
  • Loading branch information
Anush008 authored Oct 31, 2024
1 parent eba4946 commit a869128
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
12 changes: 12 additions & 0 deletions qdrant-landing/content/documentation/concepts/explore.md
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,10 @@ discover_queries = [
limit=10,
),
]

client.query_batch_points(
collection_name="{collection_name}", requests=discover_queries
)
```

```typescript
Expand Down Expand Up @@ -1189,6 +1193,10 @@ discover_queries = [
limit=10,
),
]

client.query_batch_points(
collection_name="{collection_name}", requests=discover_queries
)
```

```typescript
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion qdrant-landing/content/documentation/concepts/filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions qdrant-landing/content/documentation/concepts/hybrid-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions qdrant-landing/content/documentation/concepts/indexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
```

Expand Down Expand Up @@ -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,
),
)
Expand Down Expand Up @@ -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,
),
)
Expand Down Expand Up @@ -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,
),
)
Expand All @@ -834,7 +834,7 @@ client.createPayloadIndex("{collection_name}", {
```rust
use qdrant_client::qdrant::{
CreateFieldIndexCollectionBuilder,
IntegerdIndexParamsBuilder,
IntegerIndexParamsBuilder,
FieldType
};
use qdrant_client::{Qdrant, QdrantError};
Expand All @@ -848,7 +848,7 @@ client.create_field_index(
FieldType::Integer,
)
.field_index_params(
IntegerdIndexParamsBuilder::default()
IntegerIndexParamsBuilder::default()
.is_principal(true),
),
);
Expand Down
7 changes: 0 additions & 7 deletions qdrant-landing/content/documentation/concepts/points.md
Original file line number Diff line number Diff line change
Expand Up @@ -1705,13 +1705,6 @@ REST API ([Schema](https://api.qdrant.tech/api-reference/points/get-point)):
GET /collections/{collection_name}/points/{point_id}
```

<!--
Python client:
```python
```
-->

## Scroll points

Sometimes it might be necessary to get all stored points without knowing ids, or iterate over points that correspond to a filter.
Expand Down
21 changes: 10 additions & 11 deletions qdrant-landing/content/documentation/concepts/vectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
Expand Down Expand Up @@ -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
```
Expand Down Expand Up @@ -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]
],
)
],
Expand Down Expand Up @@ -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]
],
)
```
Expand Down Expand Up @@ -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)
),
},
)
Expand Down
6 changes: 3 additions & 3 deletions qdrant-landing/content/documentation/guides/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit a869128

Please sign in to comment.