Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support s2 index params #1381

Merged
merged 3 commits into from
Jan 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
```