You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Return index statistics including dimension, total vector count, namespaces summary, and metadata field counts.
31
31
Use an optional metadata filter to restrict the scope of counts.
32
32
33
-
JSON input may be inline, loaded from a file with @path, or read from stdin with @-.
33
+
JSON input may be inline, loaded from ./file.json, or read from stdin with '-'.
34
34
`),
35
35
Example: help.Examples(`
36
36
pc index describe-stats --index-name "index-name"
37
-
pc index describe-stats --index-name "index-name" --filter '{"k":"v"}'
38
-
pc index describe-stats --index-name "index-name" --filter @./filter.json
37
+
pc index describe-stats --index-name "index-name" --filter '{"genre":{"$eq":"rock"}}'
38
+
pc index describe-stats --index-name "index-name" --filter ./filter.json
39
39
`),
40
40
Run: func(cmd*cobra.Command, args []string) {
41
41
runDescribeIndexStatsCmd(cmd.Context(), options)
42
42
},
43
43
}
44
44
45
45
cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of index to describe stats for")
46
-
cmd.Flags().VarP(&options.filter, "filter", "f", "metadata filter to apply to the operation (inline JSON, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
46
+
cmd.Flags().VarP(&options.filter, "filter", "f", "metadata filter to apply to the operation (inline JSON, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
47
47
cmd.Flags().BoolVar(&options.json, "json", false, "output as JSON")
cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of the index to delete vectors from")
47
47
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "namespace to delete vectors from")
48
48
cmd.Flags().Var(&options.ids, "ids", "IDs of the vectors to delete")
49
-
cmd.Flags().Var(&options.filter, "filter", "filter to delete the vectors with (inline JSON, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
49
+
cmd.Flags().Var(&options.filter, "filter", "filter to delete the vectors with (inline JSON, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
50
50
cmd.Flags().BoolVar(&options.deleteAllVectors, "all-vectors", false, "delete all vectors from the namespace")
51
51
cmd.Flags().BoolVar(&options.json, "json", false, "output as JSON")
Fetch vectors from an index either by explicit IDs or by a metadata filter with optional pagination.
48
48
49
49
When using --ids, pagination flags (--limit, --pagination-token) are not applicable.
50
-
JSON inputs may be inline, loaded from a file with @path, or read from stdin with @-.
50
+
JSON inputs may be inline, loaded from ./file.json[l], or read from stdin with '-'.
51
51
A --body payload can supply ids, filter, limit, and pagination_token fields. Flags win if both are provided.
52
52
`),
53
53
Example: help.Examples(`
54
54
pc index vector fetch --index-name my-index --ids '["123","456","789"]'
55
-
pc index vector fetch --index-name my-index --ids @./ids.json
55
+
pc index vector fetch --index-name my-index --ids ./ids.json
56
56
57
-
pc index vector fetch --index-name my-index --filter '{"key": "value"}'
58
-
pc index vector fetch --index-name my-index --filter @./filter.json
57
+
pc index vector fetch --index-name my-index --filter '{"genre":{"$eq":"rock"}}'
58
+
pc index vector fetch --index-name my-index --filter ./filter.json
59
59
60
-
pc index vector fetch --index-name my-index --body @./fetch.json
61
-
cat fetch.json | pc index vector fetch --index-name my-index --body @-
60
+
pc index vector fetch --index-name my-index --body ./fetch.json
61
+
cat fetch.json | pc index vector fetch --index-name my-index --body -
62
62
`),
63
63
Run: func(cmd*cobra.Command, args []string) {
64
64
runFetchCmd(cmd.Context(), options)
65
65
},
66
66
}
67
67
68
-
cmd.Flags().VarP(&options.ids, "ids", "i", "IDs of vectors to fetch (inline JSON array, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
69
-
cmd.Flags().VarP(&options.filter, "filter", "f", "metadata filter to apply to the fetch (inline JSON, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
68
+
cmd.Flags().VarP(&options.ids, "ids", "i", "IDs of vectors to fetch (inline JSON array, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
69
+
cmd.Flags().VarP(&options.filter, "filter", "f", "metadata filter to apply to the fetch (inline JSON, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
70
70
cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of the index to fetch from")
71
71
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "namespace to fetch from")
72
72
cmd.Flags().Uint32VarP(&options.limit, "limit", "l", 0, "maximum number of vectors to fetch")
73
73
cmd.Flags().StringVarP(&options.paginationToken, "pagination-token", "p", "", "pagination token to continue a previous listing operation")
74
-
cmd.Flags().StringVar(&options.body, "body", "", "request body JSON (inline, @path.json, or @- for stdin; only one argument may use stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
74
+
cmd.Flags().StringVar(&options.body, "body", "", "request body JSON (inline, ./path.json, or '-' for stdin; only one argument may use stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
75
75
cmd.Flags().BoolVarP(&options.json, "json", "j", false, "output as JSON")
cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of the index to query")
84
84
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "index namespace to query")
85
85
cmd.Flags().Uint32VarP(&options.topK, "top-k", "k", 10, "maximum number of results to return")
86
-
cmd.Flags().VarP(&options.filter, "filter", "f", "metadata filter to apply to the query (inline JSON, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
86
+
cmd.Flags().VarP(&options.filter, "filter", "f", "metadata filter to apply to the query (inline JSON, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
87
87
cmd.Flags().BoolVar(&options.includeValues, "include-values", false, "include vector values in the query results")
88
88
cmd.Flags().BoolVar(&options.includeMetadata, "include-metadata", false, "include metadata in the query results")
89
89
cmd.Flags().StringVarP(&options.id, "id", "i", "", "ID of the vector to query against")
90
-
cmd.Flags().VarP(&options.vector, "vector", "v", "vector values to query against (inline JSON array, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
91
-
cmd.Flags().Var(&options.sparseIndices, "sparse-indices", "sparse indices to query against (inline JSON array, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
92
-
cmd.Flags().Var(&options.sparseValues, "sparse-values", "sparse values to query against (inline JSON array, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
93
-
cmd.Flags().StringVar(&options.body, "body", "", "request body JSON (inline, @path.json, or @- for stdin; only one argument may use stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
90
+
cmd.Flags().VarP(&options.vector, "vector", "v", "vector values to query against (inline JSON array, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
91
+
cmd.Flags().Var(&options.sparseIndices, "sparse-indices", "sparse indices to query against (inline JSON array, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
92
+
cmd.Flags().Var(&options.sparseValues, "sparse-values", "sparse values to query against (inline JSON array, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
93
+
cmd.Flags().StringVar(&options.body, "body", "", "request body JSON (inline, ./path.json, or '-' for stdin; only one argument may use stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
94
94
cmd.Flags().BoolVar(&options.json, "json", false, "output as JSON")
cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of the index to update")
73
73
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "namespace to update the vector in")
74
74
cmd.Flags().StringVar(&options.id, "id", "", "ID of the vector to update")
75
-
cmd.Flags().Var(&options.values, "values", "values to update the vector with (inline JSON array, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
76
-
cmd.Flags().Var(&options.sparseIndices, "sparse-indices", "sparse indices to update the vector with (inline JSON array, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
77
-
cmd.Flags().Var(&options.sparseValues, "sparse-values", "sparse values to update the vector with (inline JSON array, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
78
-
cmd.Flags().Var(&options.metadata, "metadata", "metadata to update the vector with (inline JSON, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
79
-
cmd.Flags().Var(&options.filter, "filter", "filter to update the vectors with (inline JSON, @path.json, or @- for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
75
+
cmd.Flags().Var(&options.values, "values", "values to update the vector with (inline JSON array, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
76
+
cmd.Flags().Var(&options.sparseIndices, "sparse-indices", "sparse indices to update the vector with (inline JSON array, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
77
+
cmd.Flags().Var(&options.sparseValues, "sparse-values", "sparse values to update the vector with (inline JSON array, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
78
+
cmd.Flags().Var(&options.metadata, "metadata", "metadata to update the vector with (inline JSON, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
79
+
cmd.Flags().Var(&options.filter, "filter", "filter to update the vectors with (inline JSON, ./path.json, or '-' for stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
80
80
cmd.Flags().BoolVar(&options.dryRun, "dry-run", false, "do not update the vectors, just return the number of vectors that would be updated")
81
-
cmd.Flags().StringVar(&options.body, "body", "", "request body JSON (inline, @path.json, or @- for stdin; only one argument may use stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
81
+
cmd.Flags().StringVar(&options.body, "body", "", "request body JSON (inline, ./path.json, or '-' for stdin; only one argument may use stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
82
82
cmd.Flags().BoolVar(&options.json, "json", false, "output as JSON")
cmd.Flags().StringVarP(&options.indexName, "index-name", "n", "", "name of index to upsert into")
63
63
cmd.Flags().StringVar(&options.namespace, "namespace", "__default__", "namespace to upsert into")
64
-
cmd.Flags().StringVar(&options.body, "body", "", "request body JSON or JSONL (inline, @path.json[l], or @- for stdin; only one argument may use stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
64
+
cmd.Flags().StringVar(&options.body, "body", "", "request body JSON or JSONL (inline, ./path.json[l], or '-' for stdin; only one argument may use stdin; max size: see PC_CLI_MAX_JSON_BYTES)")
65
65
cmd.Flags().IntVarP(&options.batchSize, "batch-size", "b", 500, "size of batches to upsert (default: 500)")
66
66
cmd.Flags().BoolVar(&options.json, "json", false, "output as JSON")
0 commit comments