mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-04 02:18:29 +02:00
Remove init_from from docs
This commit is contained in:
-1
@@ -1 +0,0 @@
|
||||
Description: This code snippet demonstrates creating a new collection by initializing it from an existing collection. The new collection will inherit the vector settings, such as size and distance function, from the source collection specified in the `init_from` field. It is a convenient feature for testing different configurations quickly. However, caution is advised as using `init_from` may lead to unpredictable load on the cluster, especially in performance-sensitive environments. Make sure that the vectors in both collections have matching settings for size and distance function.
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
```bash
|
||||
curl -X PUT http://localhost:6333/collections/{collection_name} \
|
||||
-H 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"vectors": {
|
||||
"size": 300,
|
||||
"distance": "Cosine"
|
||||
},
|
||||
"init_from": {
|
||||
"collection": {from_collection_name}
|
||||
}
|
||||
}'
|
||||
```
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
```csharp
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreateCollectionAsync(
|
||||
collectionName: "{collection_name}",
|
||||
vectorsConfig: new VectorParams { Size = 100, Distance = Distance.Cosine },
|
||||
initFromCollection: "{from_collection_name}"
|
||||
);
|
||||
```
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
```go
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateCollection(context.Background(), &qdrant.CreateCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
VectorsConfig: qdrant.NewVectorsConfig(&qdrant.VectorParams{
|
||||
Size: 100,
|
||||
Distance: qdrant.Distance_Cosine,
|
||||
}),
|
||||
InitFromCollection: qdrant.PtrOf("{from_collection_name}"),
|
||||
})
|
||||
```
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
```http
|
||||
PUT /collections/{collection_name}
|
||||
{
|
||||
"vectors": {
|
||||
"size": 100,
|
||||
"distance": "Cosine"
|
||||
},
|
||||
"init_from": {
|
||||
"collection": "{from_collection_name}"
|
||||
}
|
||||
}
|
||||
```
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.CreateCollection;
|
||||
import io.qdrant.client.grpc.Collections.Distance;
|
||||
import io.qdrant.client.grpc.Collections.VectorParams;
|
||||
import io.qdrant.client.grpc.Collections.VectorsConfig;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createCollectionAsync(
|
||||
CreateCollection.newBuilder()
|
||||
.setCollectionName("{collection_name}")
|
||||
.setVectorsConfig(
|
||||
VectorsConfig.newBuilder()
|
||||
.setParams(
|
||||
VectorParams.newBuilder()
|
||||
.setSize(100)
|
||||
.setDistance(Distance.Cosine)
|
||||
.build()))
|
||||
.setInitFromCollection("{from_collection_name}")
|
||||
.build())
|
||||
.get();
|
||||
```
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
```python
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_collection(
|
||||
collection_name="{collection_name}",
|
||||
vectors_config=models.VectorParams(size=100, distance=models.Distance.COSINE),
|
||||
init_from=models.InitFrom(collection="{from_collection_name}"),
|
||||
)
|
||||
```
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
```rust
|
||||
use qdrant_client::Qdrant;
|
||||
use qdrant_client::qdrant::{CreateCollectionBuilder, Distance, VectorParamsBuilder};
|
||||
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_collection(
|
||||
CreateCollectionBuilder::new("{collection_name}")
|
||||
.vectors_config(VectorParamsBuilder::new(100, Distance::Cosine))
|
||||
.init_from_collection("{from_collection_name}"),
|
||||
)
|
||||
.await?;
|
||||
```
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createCollection("{collection_name}", {
|
||||
vectors: { size: 100, distance: "Cosine" },
|
||||
init_from: { collection: "{from_collection_name}" },
|
||||
});
|
||||
```
|
||||
Reference in New Issue
Block a user