ExAliyunOts.Search.agg_max
You're seeing just the function
agg_max
, go back to ExAliyunOts.Search module for more information.
Specs
agg_max(aggregation_name(), field_name(), options()) :: map()
Calculate the maximum value of the assigned field by aggregation in the nested :aggs
option of :search_query
option in ExAliyunOts.search/4
.
Official document in Chinese | English
Example
import MyApp.TableStore
search "table", "index_name",
search_query: [
query: ...,
aggs: [
agg_max("agg_name", "score")
]
]
The aggregation_name
can be any business description string, when get the calculated results, we need to use
it to fetch them.
Options
:missing
, when the field is not existed in a row of data, if:missing
is not set, the row will be ignored in statistics; if:missing
is set, the row will use:missing
value to participate in the statistics of maximum value, by default it'snil
(not-set).