【问题标题】:How to create index for spatial module for OrientDB (2.2.x)?如何为 OrientDB (2.2.x) 的空间模块创建索引?
【发布时间】:2017-06-27 07:56:55
【问题描述】:

OrientDB 已从 2.2 升级到空间模块功能。

为此创建索引的 Java 等价物是什么:

在(几何场)空间引擎上创建索引 琉森

比如说:

ODocument location = new ODocument("OPoint");
location.field("coordinates", Arrays.asList(12.4684635, 41.8914114));

ODocument doc = new ODocument("Restaurant");
doc.field("name","Dar Poeta");
doc.field("location",location);

doc.save();

参考:http://orientdb.com/docs/2.2/Spatial-Index.html

(我在这里看到了一些代码:[http://orientdb.com/docs/2.1/Spatial-Index.html],但似乎这是针对以前版本的“空间索引”,而不是从 2.2 开始的“空间模块”。)

【问题讨论】:

标签: java lucene geospatial orientdb spatial


【解决方案1】:

您可以通过 Java 使用 OSQL 创建索引:

    db.command(new OCommandSQL("CREATE INDEX Restaurant.location ON Restaurant(location) SPATIAL ENGINE LUCENE")).execute();

【讨论】:

    猜你喜欢
    • 2017-06-27
    • 1970-01-01
    • 1970-01-01
    • 2021-08-26
    • 2011-08-13
    • 1970-01-01
    • 1970-01-01
    • 2017-07-31
    • 2014-12-13
    相关资源
    最近更新 更多