ListChunks

更新时间:
复制 MD 格式

Get document chunk details

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

The instance ID.

Note

You can call the DescribeDBInstances operation to query the details of all AnalyticDB for PostgreSQL instances in a specific region, including the instance IDs.

gp-xxxxxxxxx

RegionId

string

Yes

The region ID.

cn-hangzhou

Namespace

string

No

The name of the namespace. Default value: public.

Note

You can call the CreateNamespace operation to create a namespace or call the ListNamespaces operation to query a list of namespaces.

mynamespace

NamespacePassword

string

Yes

The password of the namespace.

Note

This parameter is specified when you call the CreateNamespace operation.

testpassword

Collection

string

Yes

The name of the document collection.

Note

A document collection is created by calling the CreateDocumentCollection operation. You can call the ListDocumentCollections operation to query the created document collections.

testcollection

FileName

string

No

The name of the file.

Note

The name of an uploaded file. You can call the ListDocuments operation to query the file list.

mydoc.txt

Filter

string

No

The filter conditions for the data to be queried. The format is the same as the WHERE clause in SQL. It is an expression that returns a Boolean value. The conditions can be simple comparison operators, such as equal to (=), not equal to (<> or !=), greater than (>), less than (<), greater than or equal to (>=), and less than or equal to (<=). They can also be more complex expressions that are combined with logical operators (AND, OR, and NOT), and conditions that use keywords such as IN, BETWEEN, and LIKE.

Note

title = 'test' AND name like 'test%'

IncludeVector

boolean

No

Specifies whether to return vectors. Default value: false.

Note
  • false: Vectors are not returned.

  • true: Vectors are returned.

true

PageSize

integer

No

The number of entries per page. Valid values:

  • 20

  • 50

  • 100

Default value: 20.

20

PageNumber

integer

No

The page number.

1

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

34b32a0a-08ef-4a87-b6be-cdd9f56fc3ad

PageNumber

integer

The current page number.

1

PageRecordCount

integer

The number of records on the current page.

20

TotalRecordCount

integer

The total number of records.

30

Chunks

object

chunks

array<object>

A list of chunks.

array<object>

Id

string

The unique ID of the chunk.

doc_1234

Content

string

The content of the chunk.

云原生数据仓库AnalyticDB PostgreSQL版提供简单、快速、经济高效的PB级云端数据仓库解决方案。

Vector

object

vector

array

The vector data.

number

A component of the vector.

[1.2123,-0.12314,...]

Metadata

object

The metadata of the chunk.

any

Custom metadata for the chunk, provided as a key-value map.

{"title":"test"}

LoaderMetadata

string

The metadata generated by the document loader.

{"page_index":0}

FileName

string

The name of the source file from which the chunk was extracted.

mydoc.txt

PageIndex

integer

The page number in the source file from which this chunk was extracted.

1

Examples

Success response

JSON format

{
  "RequestId": "34b32a0a-08ef-4a87-b6be-cdd9f56fc3ad",
  "PageNumber": 1,
  "PageRecordCount": 20,
  "TotalRecordCount": 30,
  "Chunks": {
    "chunks": [
      {
        "Id": "doc_1234",
        "Content": "云原生数据仓库AnalyticDB PostgreSQL版提供简单、快速、经济高效的PB级云端数据仓库解决方案。",
        "Vector": {
          "vector": [
            0
          ]
        },
        "Metadata": {
          "key": "{\"title\":\"test\"}"
        },
        "LoaderMetadata": "{\"page_index\":0}",
        "FileName": "mydoc.txt\n",
        "PageIndex": 1
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.