mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-09 21:08:31 +02:00
Automated snippet conversion by scripts
These changes are purely mechanical to differentiate them from manual fixes/adjustments made in the next commit. This results in broken code as some snippets contain errors. Made in four steps: 1. Run ./migrate-snippet.py that converts `.md` files to code files and perhaps adds missing lines under `// @hide` comments. 2. Sort Java imports. 3. Remove old `.md` files. 4. Run ./generate.md to produce `*/generated/*.md` files.
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreatePayloadIndexAsync(
|
||||
collectionName: "{collection_name}",
|
||||
fieldName: "name_of_the_field_to_index",
|
||||
schemaType: PayloadSchemaType.Text,
|
||||
indexParams: new PayloadIndexParams
|
||||
{
|
||||
TextIndexParams = new TextIndexParams
|
||||
{
|
||||
Tokenizer = TokenizerType.Word,
|
||||
Lowercase = true,
|
||||
AsciiFolding = true,
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
FieldName: "name_of_the_field_to_index",
|
||||
FieldType: qdrant.FieldType_FieldTypeText.Enum(),
|
||||
FieldIndexParams: qdrant.NewPayloadIndexParamsText(
|
||||
&qdrant.TextIndexParams{
|
||||
Tokenizer: qdrant.TokenizerType_Word,
|
||||
Lowercase: qdrant.PtrOf(true),
|
||||
AsciiFolding: qdrant.PtrOf(true),
|
||||
}),
|
||||
})
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
import io.qdrant.client.grpc.Collections.TextIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.TokenizerType;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createPayloadIndexAsync(
|
||||
"{collection_name}",
|
||||
"name_of_the_field_to_index",
|
||||
PayloadSchemaType.Text,
|
||||
PayloadIndexParams.newBuilder()
|
||||
.setTextIndexParams(
|
||||
TextIndexParams.newBuilder()
|
||||
.setTokenizer(TokenizerType.Word)
|
||||
.setLowercase(true)
|
||||
.setAsciiFolding(true)
|
||||
.build())
|
||||
.build(),
|
||||
null,
|
||||
null,
|
||||
null)
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
ascii_folding=True,
|
||||
),
|
||||
)
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
use qdrant_client::qdrant::{
|
||||
CreateFieldIndexCollectionBuilder,
|
||||
TextIndexParamsBuilder,
|
||||
FieldType,
|
||||
TokenizerType,
|
||||
};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
let text_index_params = TextIndexParamsBuilder::new(TokenizerType::Word)
|
||||
.ascii_folding(true);
|
||||
|
||||
client
|
||||
.create_field_index(
|
||||
CreateFieldIndexCollectionBuilder::new(
|
||||
"{collection_name}",
|
||||
"name_of_the_field_to_index",
|
||||
FieldType::Text,
|
||||
).field_index_params(text_index_params.build()),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createPayloadIndex("{collection_name}", {
|
||||
field_name: "name_of_the_field_to_index",
|
||||
field_schema: {
|
||||
type: "text",
|
||||
tokenizer: "word",
|
||||
ascii_folding: true,
|
||||
},
|
||||
});
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreatePayloadIndexAsync(
|
||||
collectionName: "{collection_name}",
|
||||
fieldName: "timestamp",
|
||||
schemaType: PayloadSchemaType.Integer,
|
||||
indexParams: new PayloadIndexParams
|
||||
{
|
||||
IntegerIndexParams = new IntegerIndexParams
|
||||
{
|
||||
IsPrincipal = true
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,9 +1,9 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.IntegerIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
import io.qdrant.client.grpc.Collections.IntegerIndexParams;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
FieldName: "name_of_the_field_to_index",
|
||||
FieldType: qdrant.FieldType_FieldTypeInteger.Enum(),
|
||||
FieldIndexParams: qdrant.NewPayloadIndexParamsInt(
|
||||
&qdrant.IntegerIndexParams{
|
||||
IsPrincipal: qdrant.PtrOf(true),
|
||||
}),
|
||||
})
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.IntegerIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createPayloadIndexAsync(
|
||||
"{collection_name}",
|
||||
"timestamp",
|
||||
PayloadSchemaType.Integer,
|
||||
PayloadIndexParams.newBuilder()
|
||||
.setIntegerIndexParams(
|
||||
KeywordIndexParams.newBuilder()
|
||||
.setIsPrincipa(true)
|
||||
.build())
|
||||
.build(),
|
||||
null,
|
||||
null,
|
||||
null)
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
from qdrant_client import QdrantClient, models # @hide
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333") # @hide
|
||||
|
||||
client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="timestamp",
|
||||
field_schema=models.IntegerIndexParams(
|
||||
type=models.IntegerIndexType.INTEGER,
|
||||
is_principal=True,
|
||||
),
|
||||
)
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
use qdrant_client::qdrant::{
|
||||
CreateFieldIndexCollectionBuilder,
|
||||
IntegerIndexParamsBuilder,
|
||||
FieldType
|
||||
};
|
||||
use qdrant_client::{Qdrant, QdrantError};
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client.create_field_index(
|
||||
CreateFieldIndexCollectionBuilder::new(
|
||||
"{collection_name}",
|
||||
"timestamp",
|
||||
FieldType::Integer,
|
||||
)
|
||||
.field_index_params(
|
||||
IntegerIndexParamsBuilder::default()
|
||||
.is_principal(true),
|
||||
),
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest"; // @hide
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 }); // @hide
|
||||
|
||||
client.createPayloadIndex("{collection_name}", {
|
||||
field_name: "timestamp",
|
||||
field_schema: {
|
||||
type: "integer",
|
||||
is_principal: true
|
||||
},
|
||||
});
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreatePayloadIndexAsync(
|
||||
collectionName: "{collection_name}",
|
||||
fieldName: "name_of_the_field_to_index",
|
||||
schemaType: PayloadSchemaType.Integer,
|
||||
indexParams: new PayloadIndexParams
|
||||
{
|
||||
IntegerIndexParams = new()
|
||||
{
|
||||
Lookup = false,
|
||||
Range = true
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
FieldName: "name_of_the_field_to_index",
|
||||
FieldType: qdrant.FieldType_FieldTypeInteger.Enum(),
|
||||
FieldIndexParams: qdrant.NewPayloadIndexParamsInt(
|
||||
&qdrant.IntegerIndexParams{
|
||||
Lookup: false,
|
||||
Range: true,
|
||||
}),
|
||||
})
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.IntegerIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createPayloadIndexAsync(
|
||||
"{collection_name}",
|
||||
"name_of_the_field_to_index",
|
||||
PayloadSchemaType.Integer,
|
||||
PayloadIndexParams.newBuilder()
|
||||
.setIntegerIndexParams(
|
||||
IntegerIndexParams.newBuilder().setLookup(false).setRange(true).build())
|
||||
.build(),
|
||||
null,
|
||||
null,
|
||||
null)
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.IntegerIndexParams(
|
||||
type=models.IntegerIndexType.INTEGER,
|
||||
lookup=False,
|
||||
range=True,
|
||||
),
|
||||
)
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
use qdrant_client::qdrant::{
|
||||
payload_index_params::IndexParams, CreateFieldIndexCollectionBuilder, FieldType,
|
||||
IntegerIndexParams, PayloadIndexParams,
|
||||
};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client
|
||||
.create_field_index(
|
||||
CreateFieldIndexCollectionBuilder::new(
|
||||
"{collection_name}",
|
||||
"name_of_the_field_to_index",
|
||||
FieldType::Integer,
|
||||
)
|
||||
.field_index_params(PayloadIndexParams {
|
||||
index_params: Some(IndexParams::IntegerIndexParams(IntegerIndexParams {
|
||||
lookup: false,
|
||||
range: true,
|
||||
})),
|
||||
}),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createPayloadIndex("{collection_name}", {
|
||||
field_name: "name_of_the_field_to_index",
|
||||
field_schema: {
|
||||
type: "integer",
|
||||
lookup: false,
|
||||
range: true,
|
||||
},
|
||||
});
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreatePayloadIndexAsync(
|
||||
collectionName: "{collection_name}",
|
||||
fieldName: "payload_field_name",
|
||||
schemaType: PayloadSchemaType.Keyword,
|
||||
indexParams: new PayloadIndexParams
|
||||
{
|
||||
KeywordIndexParams = new KeywordIndexParams
|
||||
{
|
||||
IsTenant = true
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,9 +1,9 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.KeywordIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
import io.qdrant.client.grpc.Collections.KeywordIndexParams;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
FieldName: "name_of_the_field_to_index",
|
||||
FieldType: qdrant.FieldType_FieldTypeKeyword.Enum(),
|
||||
FieldIndexParams: qdrant.NewPayloadIndexParamsKeyword(
|
||||
&qdrant.KeywordIndexParams{
|
||||
IsTenant: qdrant.PtrOf(true),
|
||||
}),
|
||||
})
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.KeywordIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createPayloadIndexAsync(
|
||||
"{collection_name}",
|
||||
"payload_field_name",
|
||||
PayloadSchemaType.Keyword,
|
||||
PayloadIndexParams.newBuilder()
|
||||
.setKeywordIndexParams(
|
||||
KeywordIndexParams.newBuilder()
|
||||
.setIsTenant(true)
|
||||
.build())
|
||||
.build(),
|
||||
null,
|
||||
null,
|
||||
null)
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
from qdrant_client import QdrantClient, models # @hide
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333") # @hide
|
||||
|
||||
client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="payload_field_name",
|
||||
field_schema=models.KeywordIndexParams(
|
||||
type=models.KeywordIndexType.KEYWORD,
|
||||
is_tenant=True,
|
||||
),
|
||||
)
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
use qdrant_client::qdrant::{
|
||||
CreateFieldIndexCollectionBuilder,
|
||||
KeywordIndexParamsBuilder,
|
||||
FieldType
|
||||
};
|
||||
use qdrant_client::{Qdrant, QdrantError};
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client.create_field_index(
|
||||
CreateFieldIndexCollectionBuilder::new(
|
||||
"{collection_name}",
|
||||
"payload_field_name",
|
||||
FieldType::Keyword,
|
||||
)
|
||||
.field_index_params(
|
||||
KeywordIndexParamsBuilder::default()
|
||||
.is_tenant(true),
|
||||
),
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest"; // @hide
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 }); // @hide
|
||||
|
||||
client.createPayloadIndex("{collection_name}", {
|
||||
field_name: "payload_field_name",
|
||||
field_schema: {
|
||||
type: "keyword",
|
||||
is_tenant: true
|
||||
},
|
||||
});
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreatePayloadIndexAsync(
|
||||
collectionName: "{collection_name}",
|
||||
fieldName: "payload_field_name",
|
||||
schemaType: PayloadSchemaType.Keyword,
|
||||
indexParams: new PayloadIndexParams
|
||||
{
|
||||
KeywordIndexParams = new KeywordIndexParams
|
||||
{
|
||||
OnDisk = true
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,9 +1,9 @@
|
||||
```java
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.KeywordIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
import io.qdrant.client.grpc.Collections.KeywordIndexParams;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
FieldName: "name_of_the_field_to_index",
|
||||
FieldType: qdrant.FieldType_FieldTypeKeyword.Enum(),
|
||||
FieldIndexParams: qdrant.NewPayloadIndexParamsKeyword(
|
||||
&qdrant.KeywordIndexParams{
|
||||
OnDisk: qdrant.PtrOf(true),
|
||||
}),
|
||||
})
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.KeywordIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createPayloadIndexAsync(
|
||||
"{collection_name}",
|
||||
"payload_field_name",
|
||||
PayloadSchemaType.Keyword,
|
||||
PayloadIndexParams.newBuilder()
|
||||
.setKeywordIndexParams(
|
||||
KeywordIndexParams.newBuilder()
|
||||
.setOnDisk(true)
|
||||
.build())
|
||||
.build(),
|
||||
null,
|
||||
null,
|
||||
null)
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
from qdrant_client import QdrantClient, models # @hide
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333") # @hide
|
||||
|
||||
client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="payload_field_name",
|
||||
field_schema=models.KeywordIndexParams(
|
||||
type=models.KeywordIndexType.KEYWORD,
|
||||
on_disk=True,
|
||||
),
|
||||
)
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
use qdrant_client::qdrant::{
|
||||
CreateFieldIndexCollectionBuilder,
|
||||
KeywordIndexParamsBuilder,
|
||||
FieldType
|
||||
};
|
||||
use qdrant_client::{Qdrant, QdrantError};
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
client.create_field_index(
|
||||
CreateFieldIndexCollectionBuilder::new(
|
||||
"{collection_name}",
|
||||
"payload_field_name",
|
||||
FieldType::Keyword,
|
||||
)
|
||||
.field_index_params(
|
||||
KeywordIndexParamsBuilder::default()
|
||||
.on_disk(true),
|
||||
),
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest"; // @hide
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 }); // @hide
|
||||
|
||||
client.createPayloadIndex("{collection_name}", {
|
||||
field_name: "payload_field_name",
|
||||
field_schema: {
|
||||
type: "keyword",
|
||||
on_disk: true
|
||||
},
|
||||
});
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreatePayloadIndexAsync(
|
||||
collectionName: "{collection_name}",
|
||||
fieldName: "name_of_the_field_to_index",
|
||||
schemaType: PayloadSchemaType.Text,
|
||||
indexParams: new PayloadIndexParams
|
||||
{
|
||||
TextIndexParams = new TextIndexParams
|
||||
{
|
||||
Tokenizer = TokenizerType.Word,
|
||||
Lowercase = true,
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
FieldName: "name_of_the_field_to_index",
|
||||
FieldType: qdrant.FieldType_FieldTypeText.Enum(),
|
||||
FieldIndexParams: qdrant.NewPayloadIndexParamsText(
|
||||
&qdrant.TextIndexParams{
|
||||
Tokenizer: qdrant.TokenizerType_Word,
|
||||
Lowercase: qdrant.PtrOf(true),
|
||||
}),
|
||||
})
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
import io.qdrant.client.grpc.Collections.TextIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.TokenizerType;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createPayloadIndexAsync(
|
||||
"{collection_name}",
|
||||
"name_of_the_field_to_index",
|
||||
PayloadSchemaType.Text,
|
||||
PayloadIndexParams.newBuilder()
|
||||
.setTextIndexParams(
|
||||
TextIndexParams.newBuilder()
|
||||
.setTokenizer(TokenizerType.Word)
|
||||
.setLowercase(true)
|
||||
.build())
|
||||
.build(),
|
||||
null,
|
||||
null,
|
||||
null)
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
lowercase=False,
|
||||
),
|
||||
)
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
use qdrant_client::qdrant::{
|
||||
CreateFieldIndexCollectionBuilder,
|
||||
TextIndexParamsBuilder,
|
||||
FieldType,
|
||||
TokenizerType,
|
||||
};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
let text_index_params = TextIndexParamsBuilder::new(TokenizerType::Word)
|
||||
.lowercase(false);
|
||||
|
||||
client
|
||||
.create_field_index(
|
||||
CreateFieldIndexCollectionBuilder::new(
|
||||
"{collection_name}",
|
||||
"name_of_the_field_to_index",
|
||||
FieldType::Text,
|
||||
).field_index_params(text_index_params.build()),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createPayloadIndex("{collection_name}", {
|
||||
field_name: "name_of_the_field_to_index",
|
||||
field_schema: {
|
||||
type: "text",
|
||||
tokenizer: "word",
|
||||
lowercase: false,
|
||||
},
|
||||
});
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreatePayloadIndexAsync(
|
||||
collectionName: "{collection_name}",
|
||||
fieldName: "name_of_the_field_to_index",
|
||||
schemaType: PayloadSchemaType.Text,
|
||||
indexParams: new PayloadIndexParams
|
||||
{
|
||||
TextIndexParams = new TextIndexParams
|
||||
{
|
||||
Tokenizer = TokenizerType.Word,
|
||||
Lowercase = true,
|
||||
PhraseMatching = true
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
FieldName: "name_of_the_field_to_index",
|
||||
FieldType: qdrant.FieldType_FieldTypeText.Enum(),
|
||||
FieldIndexParams: qdrant.NewPayloadIndexParamsText(
|
||||
&qdrant.TextIndexParams{
|
||||
Tokenizer: qdrant.TokenizerType_Whitespace,
|
||||
Lowercase: qdrant.PtrOf(true),
|
||||
PhraseMatching: qdrant.PtrOf(true),
|
||||
}),
|
||||
})
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
import io.qdrant.client.grpc.Collections.TextIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.TokenizerType;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createPayloadIndexAsync(
|
||||
"{collection_name}",
|
||||
"name_of_the_field_to_index",
|
||||
PayloadSchemaType.Text,
|
||||
PayloadIndexParams.newBuilder()
|
||||
.setTextIndexParams(
|
||||
TextIndexParams.newBuilder()
|
||||
.setTokenizer(TokenizerType.Word)
|
||||
.setLowercase(true)
|
||||
.setPhraseMatching(true)
|
||||
.build())
|
||||
.build(),
|
||||
null,
|
||||
null,
|
||||
null)
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
lowercase=True,
|
||||
phrase_matching=True,
|
||||
),
|
||||
)
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
use qdrant_client::qdrant::{
|
||||
CreateFieldIndexCollectionBuilder,
|
||||
TextIndexParamsBuilder,
|
||||
FieldType,
|
||||
TokenizerType,
|
||||
};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
let text_index_params = TextIndexParamsBuilder::new(TokenizerType::Word)
|
||||
.phrase_matching(true)
|
||||
.lowercase(true);
|
||||
|
||||
client
|
||||
.create_field_index(
|
||||
CreateFieldIndexCollectionBuilder::new(
|
||||
"{collection_name}",
|
||||
"name_of_the_field_to_index",
|
||||
FieldType::Text,
|
||||
).field_index_params(text_index_params.build()),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createPayloadIndex("{collection_name}", {
|
||||
field_name: "name_of_the_field_to_index",
|
||||
field_schema: {
|
||||
type: "text",
|
||||
tokenizer: "word",
|
||||
lowercase: true,
|
||||
phrase_matching: true,
|
||||
},
|
||||
});
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
using Qdrant.Client;
|
||||
using Qdrant.Client.Grpc;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreatePayloadIndexAsync(
|
||||
collectionName: "{collection_name}",
|
||||
fieldName: "name_of_the_field_to_index",
|
||||
schemaType: PayloadSchemaType.Text,
|
||||
indexParams: new PayloadIndexParams
|
||||
{
|
||||
TextIndexParams = new TextIndexParams
|
||||
{
|
||||
Tokenizer = TokenizerType.Word,
|
||||
MinTokenLen = 2,
|
||||
MaxTokenLen = 10,
|
||||
Lowercase = true
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package snippet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qdrant/go-client/qdrant"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
client, err := qdrant.NewClient(&qdrant.Config{
|
||||
Host: "localhost",
|
||||
Port: 6334,
|
||||
})
|
||||
|
||||
client.CreateFieldIndex(context.Background(), &qdrant.CreateFieldIndexCollection{
|
||||
CollectionName: "{collection_name}",
|
||||
FieldName: "name_of_the_field_to_index",
|
||||
FieldType: qdrant.FieldType_FieldTypeText.Enum(),
|
||||
FieldIndexParams: qdrant.NewPayloadIndexParamsText(
|
||||
&qdrant.TextIndexParams{
|
||||
Tokenizer: qdrant.TokenizerType_Whitespace,
|
||||
MinTokenLen: qdrant.PtrOf(uint64(2)),
|
||||
MaxTokenLen: qdrant.PtrOf(uint64(10)),
|
||||
Lowercase: qdrant.PtrOf(true),
|
||||
}),
|
||||
})
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.example.snippets_amalgamation;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Collections.PayloadIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.PayloadSchemaType;
|
||||
import io.qdrant.client.grpc.Collections.TextIndexParams;
|
||||
import io.qdrant.client.grpc.Collections.TokenizerType;
|
||||
|
||||
public class Snippet {
|
||||
public static void run() throws Exception {
|
||||
QdrantClient client =
|
||||
new QdrantClient(QdrantGrpcClient.newBuilder("localhost", 6334, false).build());
|
||||
|
||||
client
|
||||
.createPayloadIndexAsync(
|
||||
"{collection_name}",
|
||||
"name_of_the_field_to_index",
|
||||
PayloadSchemaType.Text,
|
||||
PayloadIndexParams.newBuilder()
|
||||
.setTextIndexParams(
|
||||
TextIndexParams.newBuilder()
|
||||
.setTokenizer(TokenizerType.Word)
|
||||
.setMinTokenLen(2)
|
||||
.setMaxTokenLen(10)
|
||||
.setLowercase(true)
|
||||
.build())
|
||||
.build(),
|
||||
null,
|
||||
null,
|
||||
null)
|
||||
.get();
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
from qdrant_client import QdrantClient, models
|
||||
|
||||
client = QdrantClient(url="http://localhost:6333")
|
||||
|
||||
client.create_payload_index(
|
||||
collection_name="{collection_name}",
|
||||
field_name="name_of_the_field_to_index",
|
||||
field_schema=models.TextIndexParams(
|
||||
type="text",
|
||||
tokenizer=models.TokenizerType.WORD,
|
||||
min_token_len=2,
|
||||
max_token_len=10,
|
||||
lowercase=True,
|
||||
),
|
||||
)
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
use qdrant_client::qdrant::{
|
||||
CreateFieldIndexCollectionBuilder,
|
||||
TextIndexParamsBuilder,
|
||||
FieldType,
|
||||
TokenizerType,
|
||||
};
|
||||
use qdrant_client::Qdrant;
|
||||
|
||||
pub async fn main() -> anyhow::Result<()> {
|
||||
let client = Qdrant::from_url("http://localhost:6334").build()?;
|
||||
|
||||
let text_index_params = TextIndexParamsBuilder::new(TokenizerType::Word)
|
||||
.min_token_len(2)
|
||||
.max_token_len(10)
|
||||
.lowercase(true);
|
||||
|
||||
client
|
||||
.create_field_index(
|
||||
CreateFieldIndexCollectionBuilder::new(
|
||||
"{collection_name}",
|
||||
"name_of_the_field_to_index",
|
||||
FieldType::Text,
|
||||
).field_index_params(text_index_params.build()),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.createPayloadIndex("{collection_name}", {
|
||||
field_name: "name_of_the_field_to_index",
|
||||
field_schema: {
|
||||
type: "text",
|
||||
tokenizer: "word",
|
||||
min_token_len: 2,
|
||||
max_token_len: 10,
|
||||
lowercase: true,
|
||||
},
|
||||
});
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
using Qdrant.Client;
|
||||
|
||||
public class Snippet
|
||||
{
|
||||
public static async Task Run()
|
||||
{
|
||||
var client = new QdrantClient("localhost", 6334);
|
||||
|
||||
await client.CreatePayloadIndexAsync(
|
||||
collectionName: "{collection_name}",
|
||||
fieldName: "name_of_the_field_to_index"
|
||||
);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user