Function: create_search_result

C Prototype

aclfvSearchResult *aclfvCreateSearchResult(uint32_t queryCnt, uint32_t *resultNum, uint32_t resultNumDataLen, uint32_t *id0, uint32_t *id1, uint32_t *resultOffset, float *resultDistance, uint32_t dataLen)

Python Function

search_result = acl.fv.create_search_result(query_cnt, result_num, result_num_data_len, id_0, id_1, result_offset, result_distance, data_len)

Function Usage

Creates data of the aclfvSearchResult type as a search result.

To destroy data of the aclfvSearchResult type, call Function: destroy_search_result.

The Atlas 200/300/500 Inference Product does not support this API.

The Atlas Training Series Product does not support this API.

Input Description

  • query_cnt: int, number of search requests, fixed to 1 in 1:N mode.
  • result_num: int, number of results per search request.
  • result_num_data_len: int, total memory size of resultNum.
  • id_0: int, repository 0 ID. The number of elements equals topk * queryCnt.
  • id_1: int, repository 1 ID. The number of elements equals topk * queryCnt.
  • result_offset: int, offset of the repository corresponding to the search results of each search request. The number of elements equals topk * queryCnt.
  • result_distance: int, distance between each search result and the search request. The number of elements equals topk * queryCnt.
  • data_len: int, size of the allocated memory, calculated as: topk * queryCnt * 4 bytes.

Return Value

search_result: int, pointer address.

  • Success: data of the aclfvSearchResult type.
  • Failure: 0.

Restrictions

None