メインコンテンツまでスキップ

クエリ (V2)

この操作は、指定されたブール式を使用してスカラー フィールドのフィルタリングを実行します。

POST/v2/vectordb/entities/query
接続エンドポイント

https://{cluster-id}.{region}.vectordb.zillizcloud.com:19530

📘ノート
  • サービングクラスターを使用している場合は、クラスターエンドポイントを使用してください。
    • Free & Serverless

      https://{cluster-id}.serverless.{region}.vectordb.zillizcloud.com

    • Dedicated

      https://{cluster-id}.{region}.vectordb.zillizcloud.com:19530

  • ${CLUSTER_ENDPOINT} を、あなたのZilliz Cloudクラスターのエンドポイントに置き換える必要があります。
  • エンドポイントを取得するには、Describe Cluster V2 APIを使用してレスポンスから値を抽出してください。
shell
export CLUSTER_ENDPOINT="https://{cluster-id}.{region}.vectordb.zillizcloud.com:19530"
パラメータ
Authorizationstringheader

認証トークンは、適切な権限を持つ API key またはusername:password のようにコロンで結合した username と password の組み合わせである必要があります。project endpoint を使用している場合は、十分な権限を持つ有効な API key のみが使用できます。

値の例: Bearer {{TOKEN}}
リクエスト・ボディ
dbNamestring

データベースの名前。

collectionNamestring必要

この操作が適用される collection の名前。

filterstring

検索の一致項目を見つけるために使用するフィルター。

outputFieldsarray

クエリ結果とともに返すフィールドの配列。

[]outputFieldsstring

出力フィールド名。

partitionNamesarray

この操作が適用される partition の名前です。このパラメーターを設定すると、操作は指定された partition に制限されます。設定しない場合、操作は collection 内のすべての partition に適用されます。

[]partitionNamesstring

partition 名。

limitinteger

返される entity の総数。 このパラメーターは、param 内の offset と組み合わせて使用することで、ページネーションを有効にできます。 この値と param 内の offset の合計は 16,384 未満である必要があります。

offsetinteger

検索結果でスキップするレコード数。 このパラメーターは、limit と組み合わせて使用することで、ページネーションを有効にできます。 この値と limit の合計は 16,384 未満である必要があります。

exprParamsobject

パラメーター化された filter 式の式テンプレート パラメーター値。

consistencyLevelstring

整合性レベル。指定可能な値は Strong、Session、Bounded、Eventually です。

orderByFieldsarray

クエリ結果の並べ替えに使用するスカラーフィールドです。各項目には、フィールド名、fieldName:asc、fieldName:desc のいずれかを指定できます。デフォルトの並べ替え方向は昇順です。

[]orderByFieldsstring

スカラーフィールドとオプションの並べ替え方向。

値の例: word_count:desc
bash
export TOKEN="db_admin:xxxxxxxxxxxxx"

curl --request POST \
--url "${CLUSTER_ENDPOINT}/v2/vectordb/entities/query" \
--header "Authorization: Bearer ${TOKEN}" \
--header "Request-Timeout: 5" \
--header "Content-Type: application/json" \
-d '{
"collectionName": "quick_setup",
"filter": "color like \"red_%\"",
"outputFields": [
"color"
],
"limit": 3,
"orderByFields": [
"color:asc"
]
}'
レスポンス

辞書のリスト。各辞書はクエリされた entity を表します。

codeinteger

レスポンス コード。

costinteger

この操作のコスト。これは free cluster と serverless cluster にのみ適用され、現在のリクエストの vCU 使用量を示します。

dataarray

辞書のリスト。各辞書はクエリされた entity を表します。

[]dataobject

entity オブジェクト

scanned_remote_bytesinteger

デプロイメントで tiered storage を使用し、usage tracking が有効になっていて、この操作が remote/disk storage から読み取る場合に返されます。すべてのデータが local cache から提供される場合は省略されます。

scanned_total_bytesinteger

デプロイメントで tiered storage を使用し、usage tracking が有効になっていて、この操作が remote/disk storage から読み取る場合に返されます。すべてのデータが local cache から提供される場合は省略されます。

cache_hit_rationumber

デプロイメントで tiered storage を使用し、usage tracking が有効になっていて、この操作が remote/disk storage から読み取る場合に返されます。すべてのデータが local cache から提供される場合は省略されます。

エラー メッセージを返します。

codeinteger

レスポンス コード。

messagestring

エラー メッセージ。

Successjson
{
"code": 0,
"cost": 0,
"data": [
{
"color": "red_7025",
"id": 1
},
{
"color": "red_4794",
"id": 4
},
{
"color": "red_9392",
"id": 6
}
]
}