如何修复在 neo4j 中创建节点索引错误?

问题描述 投票:0回答:1
  • neo4j 版本:5.7.0
  • apoc:5.7.2
  • GDSL:2.3.6

我有一个使用 neo4j 数据库的

nestjs
应用程序,我想在其中创建这样的索引:

CALL db.index.fulltext.createNodeIndex(
  "FTS_Person_Company_fullName",
  ["Person", "Company"],
  ["fullName"],
  {analyzer: "standard-folding", eventually_consistent: "true"})

但是我得到这个错误:

Neo4jError:没有为该数据库实例注册名为

db.index.fulltext.createNodeIndex
的过程。请确保您正确拼写了程序名称并且正确部署了程序。

我尝试更改neo4j的版本,但这并没有帮助解决问题。

neo4j nestjs neo4j-apoc neo4jclient
1个回答
1
投票

在neo4j 5.x中,Cypher语言直接支持creating fulltext indexes.

例如,在您的情况下:

CREATE FULLTEXT INDEX FTS_Person_Company_fullName 
FOR (n:Person|Company)
ON EACH [n.fullName]
OPTIONS {
  indexConfig: {
    `fulltext.analyzer`: "standard-folding",
    `fulltext.eventually_consistent`: true
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.