setSortMode

API definition

void setSortMode(int mode);

Function

Sets the topk sorting mode. Mode 0 indicates approximate sorting, and mode 1 indicates exact sorting.

Input

int mode: topk sorting mode.

Output

N/A

Return value

N/A

Restrictions

  • This API must be used before the Search API is used.
  • mode can be mode 0 (default) or mode 1.
    • Mode 0: Approximate sorting truncates some topk results to improve performance.
    • Mode 1: Exact sorting improves retrieval precision at the cost of certain performance.