mirror of
https://github.com/qdrant/landing_page.git
synced 2026-09-30 16:38:31 +02:00
Add TypeScript examples for Documentation & Quickstart (#376)
* Add TS examples for Documentation/Concepts * Minor FAQ improvements: spelling & formatting (#318) * Minor spelling and formatting improvements in FAQ * Add unused RAM is wasted RAM quote, improve memory text * Add TypeScript version of Quickstart (#378) * Minor FAQ improvements: spelling & formatting (#318) * Minor spelling and formatting improvements in FAQ * Add unused RAM is wasted RAM quote, improve memory text * Add TS version of quickstart --------- Co-authored-by: Tim Visée <tim@visee.me> * Add TS examples to Documentation / Guides * Fix terminology * Add TS examples to Documentation / Cloud * Add TS version of bulk upload tutorial * Format tutorials with black * Move author data to [params.author] (#385) * Add TS examples for Documentation/Concepts * Add TypeScript version of Quickstart (#378) * Minor FAQ improvements: spelling & formatting (#318) * Minor spelling and formatting improvements in FAQ * Add unused RAM is wasted RAM quote, improve memory text * Add TS version of quickstart --------- Co-authored-by: Tim Visée <tim@visee.me> * Add TS examples to Documentation / Guides * Fix terminology * Add TS examples to Documentation / Cloud * Add TS version of bulk upload tutorial * Format tutorials with black --------- Co-authored-by: Tim Visée <tim@visee.me>
This commit is contained in:
co-authored by
Tim Visée
parent
c79061a2ef
commit
a389d78bd2
@@ -40,7 +40,7 @@ from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient("localhost", port=6333)
|
||||
|
||||
client.recreate_collection(
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
vectors_config=models.VectorParams(size=768, distance=models.Distance.COSINE),
|
||||
optimizers_config=models.OptimizersConfigDiff(
|
||||
@@ -49,6 +49,22 @@ client.recreate_collection(
|
||||
)
|
||||
```
|
||||
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
vectors: {
|
||||
size: 768,
|
||||
distance: "Cosine",
|
||||
},
|
||||
optimizers_config: {
|
||||
indexing_threshold: 0,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
After upload is done, you can enable indexing by setting `indexing_threshold` to a desired value (default is 20000):
|
||||
|
||||
```http
|
||||
@@ -68,12 +84,22 @@ client = QdrantClient("localhost", port=6333)
|
||||
|
||||
client.update_collection(
|
||||
collection_name="{collection_name}",
|
||||
optimizer_config=models.OptimizersConfigDiff(
|
||||
indexing_threshold=20000
|
||||
)
|
||||
optimizer_config=models.OptimizersConfigDiff(indexing_threshold=20000),
|
||||
)
|
||||
```
|
||||
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.updateCollection("{collection_name}", {
|
||||
optimizers_config: {
|
||||
indexing_threshold: 20000,
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
## Upload directly to disk
|
||||
|
||||
When the vectors you upload do not all fit in RAM, you likely want to use
|
||||
@@ -117,9 +143,23 @@ from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient("localhost", port=6333)
|
||||
|
||||
client.recreate_collection(
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
vectors_config=models.VectorParams(size=768, distance=models.Distance.COSINE),
|
||||
shard_number=2,
|
||||
)
|
||||
```
|
||||
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
vectors: {
|
||||
size: 768,
|
||||
distance: "Cosine",
|
||||
},
|
||||
shard_number: 2,
|
||||
});
|
||||
```
|
||||
Reference in New Issue
Block a user