Function: search

C Prototype

aclError aclfvSearch(aclfvSearchType type, aclfvSearchInput *searchInput, aclfvSearchResult *searchRst)

Python Function

ret = acl.fv.search(type, search_input, search_result)

Function Usage

Performs 1:N or N:M feature search.

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

The Atlas Training Series Product does not support this API.

Input Description

  • type: int, feature description. For details, see aclfvSearchType.
  • search_input: int, address of the pointer that points to search input.

    Call acl.fv.create_search_input to create data of the aclfvSearchInput type in advance.

  • search_result: int, address of the pointer that points to search output.

    Call acl.fv.create_search_result to create data of the aclfvSearchResult type in advance. The queryCnt argument must be the same as that of searchInput.

    The number of returned search results is specified by the topk argument passed to the acl.fv.create_search_input call and is also restricted by the maximum value of topk specified by the acl.fv.init call for initialization. If the topk argument passed to the acl.fv.create_search_input call is greater than or equal to that passed to the acl.fv.init call, the maximum number set in the acl.fv.init call takes precedence; otherwise, the topk argument passed to the acl.fv.create_search_input call applies.

Return Value

ret: int, error code.

Restrictions

  • In N:M mode, multithreaded adding, search, or deletion is not allowed.
  • In 1:N or N:M mode, if no repository is added, zero results are returned by the acl.fv.search call.
  • This API call automatically creates a stream for synchronous task execution within the API. When the tasks are complete, the stream is automatically destroyed.

    Hardware has restrictions on the total number of streams. For details, see Function: create_stream.