目录

aip_retrieval_record.h

Overview

Provides APIs related to retrieval results.

The retrieval result (OH_Retrieval_Record) is the returned data of the knowledge retrieval operation, including the fields and their values retrieved from the knowledge base. The retrieval result consists of multiple database bucket arrays (OH_Retrieval_RecordItem). Each bucket array corresponds to a matched record, which contains the names and values of the fields in the record.

This function is applicable to application scenarios where related information needs to be obtained from the knowledge base and displayed, for example, obtaining retrieval results from the knowledge Q&A system and extracting matching records in intelligent recommendation.

File to include: #include "dataaugmentation/retrieval/aip_retrieval_record.h"

Library: libretrieval_ndk.so

System capability: SystemCapability.DataAugmentation.Retrieval

Since: 6.0.0(20)

Related module: Retrieval

Summary

[h2]Types

Name Description
typedef struct OH_Retrieval_Record OH_Retrieval_Record Defines the retrieval result, including the fields returned from the knowledge base and their values.
typedef struct OH_Retrieval_RecordItem OH_Retrieval_RecordItem Defines the database bucket array in the retrieval result.

[h2]Functions

Name Description
int OH_Retrieval_DestroyRecord (OH_Retrieval_Record *record) Destroys the retrieval result obtained through the retrieval API OH_Retrieval_Retrieve.
int OH_Retrieval_GetRecordLength (const OH_Retrieval_Record *record, uint32_t *length) Obtains the length of the database bucket array in the retrieval result OH_Retrieval_Record.
int OH_Retrieval_GetRecordItem (const OH_Retrieval_Record *record, uint32_t index, const OH_Retrieval_RecordItem **item) Obtains the database bucket array in the retrieval result OH_Retrieval_Record.
int OH_Retrieval_GetItemSize (const OH_Retrieval_RecordItem *items, const char *fieldName, size_t *size) Obtains the size of the value of a specified field in the database bucket array OH_Retrieval_RecordItem. The size value contains the null terminator.
int OH_Retrieval_GetItemText (const OH_Retrieval_RecordItem *items, const char *fieldName, char *value, size_t size) Obtains the value of a specified field in the database bucket array OH_Retrieval_RecordItem.