文档管理中心
您当前正在浏览HarmonyOS最新文档,覆盖已发布的所有API版本,可在API参考中筛选您使用的API版本。详细的版本配套关系请参考版本说明
API参考应用框架Data Augmentation Kit(数据增强服务)C API头文件aip_retrieval_record.h

aip_retrieval_record.h

Phone6.0.0(20)+PC/2in16.0.0(20)+Tablet6.0.0(20)+

概述

提供与检索结果相关的接口。

检索结果(OH_Retrieval_Record)是知识检索操作的返回数据,包含从知识库中检索到的字段和字段取值。检索结果由多个数据库bucket数组(OH_Retrieval_RecordItem)组成,每个bucket数组对应一条匹配的记录,其中包含该记录各字段的名称和值。

适用于需要从知识库中获取相关信息并进行展示的应用场景,例如:知识问答系统中获取检索结果、智能推荐中提取匹配记录等。

引用文件: #include "dataaugmentation/retrieval/aip_retrieval_record.h"

库: libretrieval_ndk.so

系统能力: SystemCapability.DataAugmentation.Retrieval

起始版本: 6.0.0(20)

相关模块: Retrieval

汇总

类型定义

展开
名称 描述
typedef struct OH_Retrieval_Record OH_Retrieval_Record 定义检索结果,包含检索知识库得到的字段和字段取值。
typedef struct OH_Retrieval_RecordItem OH_Retrieval_RecordItem 定义检索结果中的数据库bucket数组。

函数

展开
名称 描述
int OH_Retrieval_DestroyRecord (OH_Retrieval_Record *record) 销毁通过检索接口OH_Retrieval_Retrieve获得的检索结果。
int OH_Retrieval_GetRecordLength (const OH_Retrieval_Record *record, uint32_t *length) 获取检索结果OH_Retrieval_Record中的数据库bucket数组长度。
int OH_Retrieval_GetRecordItem (const OH_Retrieval_Record *record, uint32_t index, const OH_Retrieval_RecordItem **item) 获取检索结果OH_Retrieval_Record中的数据库bucket数组。
int OH_Retrieval_GetItemSize (const OH_Retrieval_RecordItem *items, const char *fieldName, size_t *size) 获取数据库bucket数组OH_Retrieval_RecordItem中指定字段的值的size。size值包含结束符。
int OH_Retrieval_GetItemText (const OH_Retrieval_RecordItem *items, const char *fieldName, char *value, size_t size) 获取数据库bucket数组OH_Retrieval_RecordItem中指定字段的值。
在 API参考 中进行搜索
请输入您想要搜索的关键词