Overview
Gets a list of Records contained in the table. Note that you create a database and a table in Widget Dashboard in advance.
The default number of records that can be retrieved at one time is 20. To retrieve more than 20 records, specify the limit parameter.
Filter property can be used to narrow down the records to be retrieved. Sort property promises the order in which the records are returned. For more information, see Filter & Sort section.
ex. ) sample table
id | name | product_type | price |
---|---|---|---|
1 | apple | fruits | 100 |
2 | grape | fruits | 200 |
3 | chocolate | snacks | 400 |
// request
{
"filter": {
"and": [
{
"key": "product_type",
"operator": "equal",
"value": "fruits"
}
]
},
"sort": [
{
"key": "price",
"direction": "descending"
}
]
}
// query result
{
"items": [
{
"id": "2",
"name": "grape",
"product_type": "fruits",
"price": 200
},
{
"id": "1",
"name": "apple",
"product_type": "fruits",
"price": 100
}
],
"count": 2
}
Embedding Similarity Field in Select Clause
When embedding
field in filter
or sort
conditions, similarity fields are automatically returned.
e.x) embedding field name is embedding_field
// always ${EMBEDDING FILED NAME}_similarity
{
"embedding_field_similarity": 0.988404030
}
Embedding Filter
Able to get filtered records by embedding
field.
// get a list of records whose similarities are more than 0.9
{
"filter": {
"and": [
{
"key": "embedding_field",
"operator": "greaterThanOrEqual",
"value": 0.9,
"embeddingOperator": "<=>",
"embeddingValue": "banana"
}
]
}
}
Embedding Sort
Able to get sorted records ordered similarity, when table has embedding
fields.
operator
<->
-> L2 Distance
<=>
-> cosine similarity
<#>
-> inner product
e.x)
{
"sort": [
{
"key": "embedding_field", // name of embedding field
"operator": "<=>", // cosine similarity
"value": "banana" // a word of search (sort)
},
// able to combine with normal sort coditions
{
"key": "price",
"direction": "descending"
}
]
}