ExAliyunOts.parallel_scan
You're seeing just the function
parallel_scan
, go back to ExAliyunOts module for more information.
Specs
parallel_scan(instance(), table_name(), index_name(), options()) :: result()
Leverage concurrent tasks to query matched raw data (still be with search function) more quickly, in this use case, this function is improved for speed up scan query, but no guarantee to the order of query results, and does not support the aggregation of scan query.
In general, recommend to use iterate_parallel_scan/5
or iterate_parallel_scan/7
for the common use case of parallel scan.
Official document in Chinese | English
Options
:scan_query
, required, the main option to use query.:query
, required, bind to the query functions, the same as query option ofsearch/4
.:limit
, optional, the limited size of query, defaults to 2000, the maximum value of limit is 2000.:token
, optional, when do not load all the matched rows in a single request, there will return anext_token
value in that result, and then we can pass it to:token
in the next same scan query to continue load the rest rows.:max_parallel
, required, the maximum number of concurrent, as thesplits_size
value from the response ofcompute_splits/3
.:current_parallel_id
, required, refer the official document, the available value is in [0, max_parallel).
:columns_to_get
, optional, fetch the special fields, by default it returns all fields of the search index, here are available options::all_from_index
, return all attribute column fields of search index;:none
, do not return any attribute column fields;["field1", "field2"]
, specifies the expected return attribute column fields.
session_id
, as usual, this option is required from the response ofcompute_splits/3
, if not set this option, the query result may contain duplicate data, refer the official document, once occurs anOTSSessionExpired
error, must initiate another parallel scan task to re-query data.