Star

2. 索引创建失败

我按照文档,想试一下match,在创建索引的时候报错了

[nba]> CREATE TAG INDEX player on player(name, age)
[ERROR (-8)]: invalid parm!

Fri, 13 Nov 2020 05:54:32 UTC

[nba]> CREATE TAG INDEX player_0 on player(name, age)
[ERROR (-8)]: invalid parm!

这里的报错信息完全看不懂。。。。。

name 是 string类型的吗?如果是string类型的话,在索引里需要给一个最大长度,例如
CREATE TAG INDEX player on player(name(10), age)

那如果不指定长度呢,有默认的吗

索引按照指示创建成功了,但是MATCH查的时候报错了,求大佬再看看

[nba]> CREATE TAG INDEX player on player(name(30), age)
Execution succeeded (time spent 11600/12109 us)

[nba]> REBUILD TAG INDEX player
+------------+
| New Job Id |
+------------+
| 40         |
+------------+
Got 1 rows (time spent 7353/7927 us)

 [nba]> MATCH (v:player) WHERE v.name == "Tim" RETURN v.age AS Age;
[ERROR (-8)]: Storage Error: Invalid field value: may be the filed is not NULL or without default value or wrong schema.
1赞

试一下用lookup查询?
lookup on player where player.name == “Tim” yield player.age

浙ICP备20010487号