如何仅使用密码在 neo4j 中创建空间索引? [英] How do I create a spacial index in neo4j using only cypher?

查看:23
本文介绍了如何仅使用密码在 neo4j 中创建空间索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 Neo4j 和空间索引.我找不到任何文档来演示如何通过密码执行此操作,只能通过 REST API.

I want to play with neo4j and spacial indexes. I can't find any documentation that demonstrates how to do this through cypher, only through the REST API.

是否有可能通过 Cypher 创建空间索引,比如在 Neo4j 网络控制台中?

Is it possibly to create spacial indexes through Cypher, say in the neo4j web console?

推荐答案

目前没有办法使用 Cypher 创建空间索引.您可以使用 Java API 或 REST 调用,请参阅 http://neo4j-contrib.github.io/spatial/#rest-api-create-a-spatial-index 了解详情.由于 Neo4j 浏览器允许发送 HTTP POST,您可以在那里输入:

There is currently no way to create a spatial index using Cypher. You can either use java API or a REST call, see docs at http://neo4j-contrib.github.io/spatial/#rest-api-create-a-spatial-index for details. Since Neo4j browser allows to send HTTP POST you can type there:

:POST /db/data/index/node {"name":"geom", "config": 
  {"provider":"spatial", "geometry_type":"point", "lat":"lat", "lon":"lon"}
}

或者,您可以在 neo4j-shell 中使用 index 命令.

Alternatively you can use the index command within neo4j-shell.

Neo4j Spatial for 3.0 提供存储过程来管理空间索引 - 因此一切都可以通过 cypher 完成.请参阅 https://github.com/neo4j-contrib/spatial/blob/master/src/main/java/org/neo4j/gis/spatial/procedures/SpatialProcedures.java.注意:此版本尚未发布,因此您必须自己从源代码构建.

Neo4j Spatial for 3.0 provides stored procedures to manage the spatial index - and therefore everything can be done through cypher. See https://github.com/neo4j-contrib/spatial/blob/master/src/main/java/org/neo4j/gis/spatial/procedures/SpatialProcedures.java. Note: this version is not yet released, so you have to build from source yourself.

这篇关于如何仅使用密码在 neo4j 中创建空间索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆