【问题标题】:Setting up geolocation index in Aurelius Titan 0.5+在 Aurelius Titan 0.5+ 中设置地理定位索引
【发布时间】:2014-11-18 17:07:18
【问题描述】:

我正在努力弄清楚如何在 Titan 0.5.1 中设置地理位置索引以及如何使用它。

以前,在 Titan 0.4 中,您可以执行以下操作:

g = rexster.getGraph("graph")

location = g.makeKey("location").dataType(Geoshape.class).indexed("search", Edge.class).make();

这在新的 0.5 API 中不起作用。我一直在查看文档中的几乎所有内容,并且我查看了源代码本身没有任何运气。

在 Titan 0.5.1 中如何实现这一点,设置后如何使用它?

谢谢:)

【问题讨论】:

    标签: indexing geolocation titan


    【解决方案1】:

    GraphOfTheGodsFactory 代码始终显示它在当前版本中是如何完成的。

    // create type and index
    final PropertyKey place = mgmt.makePropertyKey("place").dataType(Geoshape.class).make();
    TitanGraphIndex eindex = mgmt.buildIndex("edges",Edge.class)
            .addKey(reason).addKey(place).buildMixedIndex(INDEX_NAME);
    
    // insert data
    ElementHelper.setProperties(hercules.addEdge("battled", nemean),
            "time", 1, "place", Geoshape.point(38.1f, 23.7f));
    

    查询与 0.4 中的相同(使用 Geo.WITHIN 搜索位于给定圆圈内的点)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-16
      • 1970-01-01
      • 2019-04-08
      • 1970-01-01
      相关资源
      最近更新 更多