我有一个使用 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 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
}
}