Function: search

Description

Performs 1:N or N:M feature search.

The Atlas inference accelerator module of the Atlas inference product does not support this API.

Prototype

  • C Prototype
    1
    aclError aclfvSearch(aclfvSearchType type, aclfvSearchInput *searchInput, aclfvSearchResult *searchRst)
    
  • Python Function
    1
    ret = acl.fv.search(type, search_input, search_result)
    

Parameters

Parameter

Description

type

Feature description. The value is of the int type. For details, see the description of aclfvSearchType.

search_input

  • Int, address of the pointer that points to search input.

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

search_result

  • Int, address of the pointer that points to the search output.

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

    The number of results returned by the retrieval output is specified by the topK parameter of the acl.fv.create_search_input API. However, the number is related to the maximum number of topK results set when the acl.fv.init API is called for initialization. If the value of topK set by the acl.fv.create_search_input API is greater than or equal to the maximum number of topK results set during initialization, when the retrieval output is returned: The retrieval result is returned based on the maximum number of topK results set during initialization. If the value of topK set by the acl.fv.create_search_input API is less than the maximum number of topK results set during initialization, the retrieval result is returned based on the value of topK set by the acl.fv.create_search_input API.

Return Value

Return Value

Description

ret

Int, error code.

Restrictions

  • In N:M mode, multithreaded adding, search, or deletion is not allowed.
  • In N:M or 1:N 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.

    Due to hardware restrictions, the total number of streams is limited. For details, see the description of Function: create_stream.

Reference

For details about the API call sequence and sample code, see Feature Vector Search.