Skip to content

Commit

Permalink
support s2 index params (#1381)
Browse files Browse the repository at this point in the history
* support s2 index params

* update

* Update docs-2.0/3.ngql-guide/3.data-types/10.geography.md

Co-authored-by: randomJoe211 <69501902+randomJoe211@users.noreply.github.com>
  • Loading branch information
cooper-lzy and randomJoe211 committed Jan 12, 2022
1 parent e436e5a commit f74251d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs-2.0/3.ngql-guide/3.data-types/10.geography.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,21 @@ nebula> LOOKUP ON any_shape YIELD ST_ASText(any_shape.geo);
+----------+-------------------------------------------------+
| "103" | "POLYGON((0 1, 1 2, 2 3, 0 1))" |
+----------+-------------------------------------------------+
```

为 geo 属性创建索引时,还可以指定 geo 索引的参数。说明如下。

<!--https://www.cockroachlabs.com/docs/stable/spatial-indexes.html-->

|参数|默认值|说明|
|:---|:--|:---|
|`s2_max_level` |`30`| S2 cell 用于填充的最大等级。取值:`1`~`30`。设置为小于默认值时,意味着会使用较大的单元格进行填充。 |
|`s2_max_cells` |`8`|S2 cell 用于填充的最大数量,可以限制填充时的工作量。取值:`1`~`30`。对于复杂形状的区域(例如细矩形),可以使用更大的值。 |

!!! note

指定如上两个参数对 Point 类型属性没有影响,Point 类型属性的`s2_max_level`强制为`30`。

```ngql
nebula> CREATE TAG INDEX IF NOT EXISTS any_shape_geo_index ON any_shape(geo) with (s2_max_level=30, s2_max_cells=8);
```

0 comments on commit f74251d

Please sign in to comment.