Skip to content

Commit c8868a7

Browse files
authored
Updated RESTful sample code (#1777)
### What problem does this PR solve? ### Type of change - [x] Documentation Update
1 parent d0b774e commit c8868a7

File tree

2 files changed

+111
-11
lines changed

2 files changed

+111
-11
lines changed

docs/references/http_api_reference.mdx

+35-10
Original file line numberDiff line numberDiff line change
@@ -324,31 +324,38 @@ curl --request POST \
324324
},
325325
{
326326
"name": "score",
327-
"type": "float"
327+
"type": "float",
328+
"default": 3.0
328329
},
329330
{
330331
"name": "dense_column",
331-
"type": "vector,8,float"
332+
"type": "vector,8,float",
333+
"default`: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
332334
},
333335
{
334-
"name": "body",
335-
"type": "varchar"
336+
"name": "fulltext_column",
337+
"type": "varchar",
338+
"default": ""
336339
},
337340
{
338341
"name": "sparse_column",
339-
"type": "sparse,8,float,int"
342+
"type": "sparse,128,float,int",
343+
"default": {"10":1.1, "20":2.2, "30": 3.3}
340344
},
341345
{
342346
"name": "tensor_column",
343-
"type": "tensor,8,float"
347+
"type": "tensor,4,float",
348+
"default": [[1.0, 0.0, 0.0, 0.0], [1.1, 0.0, 0.0, 0.0]]
344349
},
345350
{
346351
"name": "multivector_column",
347-
"type": "multivector,8,float"
352+
"type": "multivector,4,float",
353+
"default": [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]
348354
},
349355
{
350356
"name": "tensorarray_column",
351-
"type": "tensorarray,8,float"
357+
"type": "tensorarray,2,float",
358+
"default": [[[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0]]]
352359
}
353360
]
354361
} '
@@ -402,6 +409,8 @@ curl --request POST \
402409
- `"int64"`
403410
- `"float"`/`"float32"`
404411
- `"double"`/`"float64"`
412+
- `"float16"`
413+
- `"bfloat16"`
405414
- Sparse vector: e.g., `"sparse,128,float,int"`
406415
- `sparse`: The column is a sparse vector column.
407416
- The second item in the string: The dimension of the sparse vector.
@@ -412,6 +421,8 @@ curl --request POST \
412421
- `"int64"`
413422
- `"float"`/`"float32"`
414423
- `"double"`/`"float64"`
424+
- `"float16"`
425+
- `"bfloat16"`
415426
- The fourth item in the string: The data type of the sparse vector indices. Can be:
416427
- `int8`
417428
- `int16`
@@ -427,6 +438,8 @@ curl --request POST \
427438
- `"int64"`
428439
- `"float"`/`"float32"`
429440
- `"double"`/`"float64"`
441+
- `"float16"`
442+
- `"bfloat16"`
430443
- Tensor array: e.g., `"tensorarray,6,float"`
431444
- `tensorarray`: The column is a tensor-array column.
432445
- The second item in the string: The dimension of each vector unit in the tensor arrays.
@@ -437,6 +450,8 @@ curl --request POST \
437450
- `"int64"`
438451
- `"float"`/`"float32"`
439452
- `"double"`/`"float64"`
453+
- `"float16"`
454+
- `"bfloat16"`
440455
- Multivector: e.g., `"multivector,128,float"`
441456
- `multivector`: The column is a multi-vector column.
442457
- The second item in the string: The dimension of each vector unit.
@@ -447,6 +462,10 @@ curl --request POST \
447462
- `"int64"`
448463
- `"float"`/`"float32"`
449464
- `"double"`/`"float64"`
465+
- `"float16"`
466+
- `"bfloat16"`
467+
- `"default"`: `Any`, *Optional*
468+
The default value for unspecified cells in that column.
450469

451470
### Response
452471

@@ -1081,7 +1100,7 @@ The response includes a JSON object like the following:
10811100
"indexes":
10821101
[
10831102
{
1084-
"columns": "vector_column",
1103+
"columns": "vector_column_1",
10851104
"index_name": "idx1",
10861105
"index_type": "HNSW"
10871106
},
@@ -1418,7 +1437,13 @@ curl --request POST \
14181437
},
14191438
{
14201439
"name": "Neil",
1421-
"score": 2.0
1440+
"score": 2.0,
1441+
"fulltext_column": "You're absolutely lucky.",
1442+
"dense_column": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
1443+
"sparse_column": {"10":1.1, "20":2.2, "30": 3.3},
1444+
"tensor_column": [[1.0, 0.0, 0.0, 0.0], [1.1, 0.0, 0.0, 0.0]],
1445+
"tensorarray_column": [[[1.0, 1.0], [1.0, 1.0]], [[1.0, 1.0]]],
1446+
"multivector_column": [[0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0]]
14221447
}
14231448
] '
14241449
```

docs/references/pysdk_api_reference.md

+76-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,82 @@ A non-empty string indicating the name of the table, which must adhere to the fo
332332
Definitions for all table columns as a dictionary. Each key in the dictionary is a column name (`str`), with a corresponding 'value' dictionary defining the column's data type and default value information in key-value pairs:
333333

334334
- **Data type** (`"type"`)
335-
The data type of the column.
335+
The data type of the column.
336+
- Numeric:
337+
- `"int8"`
338+
- `"int16"`
339+
- `"int"`/`"int32"`/`"integer"`
340+
- `"int64"`
341+
- `"float"`/`"float32"`
342+
- `"double"`/`"float64"`
343+
- `"float16"`
344+
- `"bfloat16"`
345+
- String: `"varchar"`
346+
- Dense vector: e.g., `"vector,128,float"`
347+
- `vector`: The column is a dense vector column.
348+
- The second item in the string: The dimension of the dense vector.
349+
- The third item in the string: The element type of the dense vector. Can be:
350+
- `"int8"`
351+
- `"int16"`
352+
- `"int"`/`"int32"`/`"integer"`
353+
- `"int64"`
354+
- `"float"`/`"float32"`
355+
- `"double"`/`"float64"`
356+
- `"float16"`
357+
- `"bfloat16"`
358+
- Sparse vector: e.g., `"sparse,128,float,int"`
359+
- `sparse`: The column is a sparse vector column.
360+
- The second item in the string: The dimension of the sparse vector.
361+
- The third item in the string: The element type of the sparse vector. Can be:
362+
- `"int8"`
363+
- `"int16"`
364+
- `"int"`/`"int32"`/`"integer"`
365+
- `"int64"`
366+
- `"float"`/`"float32"`
367+
- `"double"`/`"float64"`
368+
- `"float16"`
369+
- `"bfloat16"`
370+
- The fourth item in the string: The data type of the sparse vector indices. Can be:
371+
- `int8`
372+
- `int16`
373+
- `int`/`int32`/`integer`
374+
- `int64`
375+
- Tensor vector: e.g., `"tensor,4,float"`
376+
- `tensor`: The column is a tensor column.
377+
- The second item in the string: The dimension of each vector unit in the tensor.
378+
- The third item in the string: The element type of the tensors. Can be:
379+
- `"int8"`
380+
- `"int16"`
381+
- `"int"`/`"int32"`/`"integer"`
382+
- `"int64"`
383+
- `"float"`/`"float32"`
384+
- `"double"`/`"float64"`
385+
- `"float16"`
386+
- `"bfloat16"`
387+
- Tensor array: e.g., `"tensorarray,6,float"`
388+
- `tensorarray`: The column is a tensor-array column.
389+
- The second item in the string: The dimension of each vector unit in the tensor arrays.
390+
- The third item in the string: The element type of the tensors. Can be:
391+
- `"int8"`
392+
- `"int16"`
393+
- `"int"`/`"int32"`/`"integer"`
394+
- `"int64"`
395+
- `"float"`/`"float32"`
396+
- `"double"`/`"float64"`
397+
- `"float16"`
398+
- `"bfloat16"`
399+
- Multivector: e.g., `"multivector,128,float"`
400+
- `multivector`: The column is a multi-vector column.
401+
- The second item in the string: The dimension of each vector unit.
402+
- The third item in the string: The element type of the tensors. Can be:
403+
- `"int8"`
404+
- `"int16"`
405+
- `"int"`/`"int32"`/`"integer"`
406+
- `"int64"`
407+
- `"float"`/`"float32"`
408+
- `"double"`/`"float64"`
409+
- `"float16"`
410+
- `"bfloat16"`
336411
- **Default value** (`"default"`)
337412
The default value for unspecified cells in that column.
338413

0 commit comments

Comments
 (0)