【问题标题】:Rexster extension using Neo4j Lucene index使用 Neo4j Lucene 索引的 Rexster 扩展
【发布时间】:2014-05-20 21:26:33
【问题描述】:

我正在尝试在Java 中编写一个Rexster 扩展,其中包括使用Neo4j 2.0 Lucene indices 查询节点。

从我能找到的几个线程(大部分是旧的 Google Group 线程)来看,使用Blueprint's Graph 似乎是不可能的。

我想到了一个可能的解决方案,我从扩展程序访问底层 Neo4jGraph 类:

@RexsterContext Graph graph

参数,但我不确定如何执行此操作。

理想的最终目标是使用自动get-or-create-index 方法,可以通过Lucene index 上的一段文本调用该方法。

有什么想法吗?

提前谢谢你!

【问题讨论】:

    标签: neo4j lucene tinkerpop rexster


    【解决方案1】:

    我想你在这里说的是答案:

    我想到了一个可能的解决方案,我可以访问底层 扩展中的 Neo4jGraph 类:

    @RexsterContext 图表图表

    如果您需要来自 Blueprints Neo4jGraph 的方法,那么只需将 Graph 转换为:

    Neo4jGraph neo4j = (Neo4jGraph) neo4j;
    

    此外,如果您需要使用特定的本地 Neo4j 类/方法,那么只需执行以下操作:

    GraphDatabaseService graphdb = neo4j.getRawGraph()
    

    显然,这两种方法都使您的 Rexster Extension Neo4j 特定,但听起来这对您的情况来说是可以的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-20
      • 1970-01-01
      • 1970-01-01
      • 2012-09-28
      • 2014-05-31
      • 1970-01-01
      • 2014-06-11
      • 1970-01-01
      相关资源
      最近更新 更多