ExAliyunOts.Search.range_query
You're seeing just the function
range_query
, go back to ExAliyunOts.Search module for more information.
Specs
range_query(field_name(), Range.t() | options()) :: map()
Use RangeQuery as the nested :query
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: range_query(
"score",
from: 60,
to: 80,
include_upper: false,
include_lower: false
)
]
# or support Range
search "table", "index_name",
search_query: [
query: range_query("score", 60..80)
]
# equal to
search "table", "index_name",
search_query: [
query: range_query("score", from: 60, to: 80)
]
Options
:from
, the value of the start position.:to
, the value of the end position.:include_lower
, specifies whether to include the:from
value in the result, available options aretrue
|false
, by default it'strue
.:include_upper
, specifies whether to include the:to
value in the result, available options aretrue
|false
, by default it'strue
.