From db99b52ae7c69c6eef00c2dc499e34ba44ca3d31 Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Fri, 10 Sep 2021 11:38:39 +0800 Subject: [PATCH 1/3] add cn doc --- .../6.functions-and-expressions/13.concat.md | 105 ++++++++++++++++++ .../6.show/19.show-meta-leader.md | 29 +++++ .../1.authentication/4.ldap.md | 103 +++++++++++++++++ .../improve-query-by-tag-index.md | 53 +++++++++ mkdocs.yml | 6 + 5 files changed, 296 insertions(+) create mode 100644 docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md create mode 100644 docs-2.0/3.ngql-guide/7.general-query-statements/6.show/19.show-meta-leader.md create mode 100644 docs-2.0/7.data-security/1.authentication/4.ldap.md create mode 100644 docs-2.0/8.service-tuning/improve-query-by-tag-index.md diff --git a/docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md b/docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md new file mode 100644 index 00000000000..a17ee2c9de5 --- /dev/null +++ b/docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md @@ -0,0 +1,105 @@ + \ No newline at end of file diff --git a/docs-2.0/3.ngql-guide/7.general-query-statements/6.show/19.show-meta-leader.md b/docs-2.0/3.ngql-guide/7.general-query-statements/6.show/19.show-meta-leader.md new file mode 100644 index 00000000000..432a00f815d --- /dev/null +++ b/docs-2.0/3.ngql-guide/7.general-query-statements/6.show/19.show-meta-leader.md @@ -0,0 +1,29 @@ + +# SHOW META LEADER + +`SHOW META LEADER`语句显示当前Meta集群的leader信息。 + +关于Meta服务的详细说明请参见[Meta 服务](../../../1.introduction/3.nebula-graph-architecture/2.meta-service.md)。 + +## 语法 + +```ngql +SHOW META LEADER; +``` + +## 示例 + +```ngql +nebula> SHOW META LEADER; ++------------------+---------------------------+ +| Meta Leader | secs from last heart beat | ++------------------+---------------------------+ +| "127.0.0.1:9559" | 3 | ++------------------+---------------------------+ +``` + +|参数|说明| +|:---|:---| +|`Meta Leader`|Meta集群的leader信息,包括leader所在服务器的IP地址和端口。| +|`secs from last heart beat`|距离上次心跳的时间间隔。单位:秒。| +--> \ No newline at end of file diff --git a/docs-2.0/7.data-security/1.authentication/4.ldap.md b/docs-2.0/7.data-security/1.authentication/4.ldap.md new file mode 100644 index 00000000000..05dcd06cf9d --- /dev/null +++ b/docs-2.0/7.data-security/1.authentication/4.ldap.md @@ -0,0 +1,103 @@ + \ No newline at end of file diff --git a/docs-2.0/8.service-tuning/improve-query-by-tag-index.md b/docs-2.0/8.service-tuning/improve-query-by-tag-index.md new file mode 100644 index 00000000000..2fdfab05049 --- /dev/null +++ b/docs-2.0/8.service-tuning/improve-query-by-tag-index.md @@ -0,0 +1,53 @@ + +# 增加和删除标签 + +在openCypher中,有增加标签(`SET label`)和移除标签(`REMOVE label`)的功能,可以用于加速查询或者标记过程。 + +在Nebula Graph中,可以通过Tag变相实现相同操作,创建Tag并将Tag插入到已有的点上,就可以根据Tag名称快速查找点,也可以通过`DELETE TAG`删除某些点上不再需要的Tag。 + +!!! caution + + 请确保点上已经有另一个Tag,否则删除点上最后一个Tag时,会导致点也被删除。 + +## 示例 + +例如在basketballplayer数据集中,部分篮球运动员同时也是球队股东,可以为股东Tag`shareholder`创建索引,方便快速查找。如果不再是股东,可以通过`DELETE TAG`语句删除相应运动员的股东Tag。 + +```ngql +//创建股东Tag和索引 +nebula> CREATE TAG shareholder(); +nebula> CREATE TAG INDEX shareholder_tag on shareholder(); +//为点添加Tag +nebula> INSERT VERTEX shareholder() VALUES "player100":(); +nebula> INSERT VERTEX shareholder() VALUES "player101":(); +//快速查询所有股东 +nebula> MATCH (v:shareholder) RETURN v; ++---------------------------------------------------------------------+ +| v | ++---------------------------------------------------------------------+ +| ("player100" :player{age: 42, name: "Tim Duncan"} :shareholder{}) | ++---------------------------------------------------------------------+ +| ("player101" :player{age: 36, name: "Tony Parker"} :shareholder{}) | ++---------------------------------------------------------------------+ +nebula> LOOKUP ON shareholder; ++-------------+ +| VertexID | ++-------------+ +| "player100" | ++-------------+ +| "player101" | ++-------------+ +//如果player100不再是股东 +nebula> DELETE TAG shareholder FROM "player100"; +nebula> LOOKUP ON shareholder; ++-------------+ +| VertexID | ++-------------+ +| "player101" | ++-------------+ +``` + +!!! note + + 如果插入测试数据后才创建索引,请用`REBUILD TAG INDEX ;`语句重建索引。 +--> \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 6ccdb377de6..2dc1f0ab258 100755 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -162,6 +162,7 @@ nav: - collect(): 3.ngql-guide/6.functions-and-expressions/10.collect.md - reduce(): 3.ngql-guide/6.functions-and-expressions/11.reduce.md - hash(): 3.ngql-guide/6.functions-and-expressions/12.hash.md + - concat(): 3.ngql-guide/6.functions-and-expressions/13.concat.md - Predicate functions: 3.ngql-guide/6.functions-and-expressions/8.predicate.md - User-defined functions: 3.ngql-guide/6.functions-and-expressions/9.user-defined-functions.md @@ -189,6 +190,7 @@ nav: - SHOW USERS: 3.ngql-guide/7.general-query-statements/6.show/16.show-users.md - SHOW SESSIONS: 3.ngql-guide/7.general-query-statements/6.show/17.show-sessions.md - SHOW QUERIES: 3.ngql-guide/7.general-query-statements/6.show/18.show-queries.md + - SHOW META LEADER: 3.ngql-guide/7.general-query-statements/6.show/19.show-meta-leader.md - Clauses and options: - GROUP BY: 3.ngql-guide/8.clauses-and-options/group-by.md @@ -213,6 +215,8 @@ nav: - ALTER TAG: 3.ngql-guide/10.tag-statements/3.alter-tag.md - SHOW TAGS: 3.ngql-guide/10.tag-statements/4.show-tags.md - DESCRIBE TAG: 3.ngql-guide/10.tag-statements/5.describe-tag.md + - DELETE TAG: 3.ngql-guide/10.tag-statements/6.delete-tag.md + - Edge type statements: - CREATE EDGE: 3.ngql-guide/11.edge-type-statements/1.create-edge.md - DROP EDGE: 3.ngql-guide/11.edge-type-statements/2.drop-edge.md @@ -295,6 +299,7 @@ nav: - Authentication: 7.data-security/1.authentication/1.authentication.md - User management: 7.data-security/1.authentication/2.management-user.md - Roles and privileges: 7.data-security/1.authentication/3.role-list.md + - OpenLDAP authentication: 7.data-security/1.authentication/4.ldap.md # - Backup & Restore: # - What is Backup & Restore: 7.data-security/2.backup-restore/1.what-is-br.md # - Compile BR: 7.data-security/2.backup-restore/2.compile-br.md @@ -309,6 +314,7 @@ nav: - System design suggestions: 8.service-tuning/3.system-design.md - Execution plan: 8.service-tuning/4.plan.md - Processing super vertices: 8.service-tuning/super-node.md + - Add or delete tag: 8.service-tuning/improve-query-by-tag-index.md - Client: - Clients overview: 14.client/1.nebula-client.md From 3ccc15d2103ef1ed729b9ec6bb2419947d836c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=99=93=E9=9D=92?= <86282370+izhuxiaoqing@users.noreply.github.com> Date: Fri, 10 Sep 2021 18:03:24 +0800 Subject: [PATCH 2/3] concat and show meta leader --- .../6.functions-and-expressions/13.concat.md | 50 ++++++++++--------- .../6.show/19.show-meta-leader.md | 16 +++--- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md b/docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md index a17ee2c9de5..f506fe7bdb6 100644 --- a/docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md +++ b/docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md @@ -1,23 +1,25 @@ - \ No newline at end of file diff --git a/docs-2.0/3.ngql-guide/7.general-query-statements/6.show/19.show-meta-leader.md b/docs-2.0/3.ngql-guide/7.general-query-statements/6.show/19.show-meta-leader.md index 432a00f815d..60f9afaad56 100644 --- a/docs-2.0/3.ngql-guide/7.general-query-statements/6.show/19.show-meta-leader.md +++ b/docs-2.0/3.ngql-guide/7.general-query-statements/6.show/19.show-meta-leader.md @@ -1,17 +1,16 @@ - # SHOW META LEADER -`SHOW META LEADER`语句显示当前Meta集群的leader信息。 +The `SHOW META LEADER` statement shows the information of the leader in the current Meta cluster. -关于Meta服务的详细说明请参见[Meta 服务](../../../1.introduction/3.nebula-graph-architecture/2.meta-service.md)。 +For more information about the Meta service, see [Meta service](../../../1.introduction/3.nebula-graph-architecture/2.meta-service.md). -## 语法 +## Syntax ```ngql SHOW META LEADER; ``` -## 示例 +## Example ```ngql nebula> SHOW META LEADER; @@ -22,8 +21,7 @@ nebula> SHOW META LEADER; +------------------+---------------------------+ ``` -|参数|说明| +|Parameter|Description| |:---|:---| -|`Meta Leader`|Meta集群的leader信息,包括leader所在服务器的IP地址和端口。| -|`secs from last heart beat`|距离上次心跳的时间间隔。单位:秒。| ---> \ No newline at end of file +|`Meta Leader`|Shows the information of the leader in the Meta cluster, including the IP address and port of the server where the leader is located.| +|`secs from last heart beat`|Indicates the time interval since the last heartbeat. This parameter is measured in seconds.| From 273f1c2021b186788cb4a52074a8bd02b68f8df7 Mon Sep 17 00:00:00 2001 From: "max.zhu@vesoft.com" <86282370+izhuxiaoqing@users.noreply.github.com> Date: Mon, 13 Sep 2021 10:53:33 +0800 Subject: [PATCH 3/3] Update 13.concat.md --- docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md b/docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md index f506fe7bdb6..7be8e392f96 100644 --- a/docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md +++ b/docs-2.0/3.ngql-guide/6.functions-and-expressions/13.concat.md @@ -8,7 +8,7 @@ The `concat()` function requires at least two or more strings. All the parameter - If there is only one string, the string itself is returned. -- If any one of the string is `NULL`, `NULL` is returned. +- If any one of the strings is `NULL`, `NULL` is returned. ### Syntax