add filter part-2

This commit is contained in:
liujianhuan 2021-01-18 16:47:16 +08:00
parent c38baf1e88
commit 297367cf82
3 changed files with 78 additions and 1 deletions

View File

@ -247,5 +247,82 @@ Like过滤器支持使用提取函数详情可见 [带提取函数的过滤
}
```
### **边界过滤器(Bound Filter)**
边界过滤器可以过滤一定范围内的维度值, 它可以用来比较大于、小于、大于等于、小于等于等
| 属性 | 类型 | 描述 | 是否必须 |
|-|-|-|-|
| `type` | String | 该值始终为`fragment` | 是 |
| `dimension` | String | 需要过滤的维度 | 是 |
| `lower` | String | 边界过滤的下边界 | 是 |
| `upper` | String | 边界过滤的上边界 | 是 |
| `lowerStrict` | Boolean | 下边界严格比较, 是">"而非">=" | 否默认为false |
| `upperStrict` | Boolean | 上边界严格比较,是"<"而非"<=" | 否默认为false |
| `ordering` | String | 指定将值与边界进行比较时要使用的排序顺序。值可以为以下值之一:"lexicographic", "alphanumeric", "numeric", "strlen", "version"。 详情可以查看 [Sorting-Orders](sorting-orders.md) | 否,默认为"lexicographic" |
| `extractionFn` | [提取函数](dimensionspec.md) | 对维度使用的 [提取函数](dimensionspec.md) | 否 |
边界过滤器支持使用提取函数,详情可见 [带提取函数的过滤器](#带提取函数的过滤器)
以下边界过滤器表达式指的是 `21 <= age <= 31`:
```json
{
"type": "bound",
"dimension": "age",
"lower": "21",
"upper": "31" ,
"ordering": "numeric"
}
```
以下表达式表达的是 `foo <= name <= hoo`, 使用默认的排序方式:
```json
{
"type": "bound",
"dimension": "name",
"lower": "foo",
"upper": "hoo"
}
```
使用严格边界,以下表达式表示 `21 < age < 31`:
```json
{
"type": "bound",
"dimension": "age",
"lower": "21",
"lowerStrict": true,
"upper": "31" ,
"upperStrict": true,
"ordering": "numeric"
}
```
以下表达式表示了一个单一边界,表示 `age < 31`:
```json
{
"type": "bound",
"dimension": "age",
"upper": "31" ,
"upperStrict": true,
"ordering": "numeric"
}
```
相反,以下表达式表示 `age >= 18`:
```json
{
"type": "bound",
"dimension": "age",
"lower": "18" ,
"ordering": "numeric"
}
```
#### **带提取函数的过滤器**

BIN
img/support.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -9,7 +9,7 @@ obox1.style.display = "none";
obox1.setAttribute("class", "movie")
var obox2 = document.createElement("div")
obox2.innerHTML = '<img src = "/img/support.png" width = "200" height = "90" />';
obox2.innerHTML = '<img src = "/img/support.gif" width = "400" height = "250" />';
obox2.style.position = "fixed";
obox2.style.bottom = "0px";
obox2.style.left = "0px";