【问题标题】:Bulbs - Index Lookup灯泡 - 索引查找
【发布时间】:2015-10-06 02:27:44
【问题描述】:

我在按属性查找顶点时遇到问题。

在他引用的文档中:

这将返回所有具有“name”属性的顶点,其值为“James”: g.vertices.index.lookup vertices = (name = "James")。

我创建了一个名为 Product 的模型:

from bulbs.titan import Graph as Rexter
from bulbs.model import Node, NodeProxy, Relationship, build_data
from bulbs.property import String, Integer, DateTime
from bulbs.utils import current_datetime

# Nodes
class Product(Node):  
    element_type = "product"

    name = String(nullable=False)
    pid = Integer(nullable=False, indexed=True)
    view_count = Integer(default=0, nullable=False)
    created = DateTime(default=current_datetime, nullable=False)

并添加一些信息。

当我运行g.vertices.index.lookup(pid =318) 时,返回如下:

GET url: http://localhost:8182/graphs/graph/vertices?value=318&key=pid
GET body: None

如果我在 Gremlin 中并运行 g.V('pid', 318).map() 它会返回:

== > { created = 1437049813 , name = Gladiator (2000 ) , pid = 3578 ,   ELEMENT_TYPE = product, view_count = 0}

为什么我不能通过灯泡获得顶点?

谢谢!

【问题讨论】:

    标签: python titan gremlin bulbs


    【解决方案1】:

    这个问题已经在其他领域讨论过了,所以为了完整起见,我会在这里回答......

    此问题与 Bulbs 未明确向 URL 添加类型提示有关。从 Rexster 的角度来看,以下内容应该有效:

    卷曲“http://localhost:8182/graphs/graph/vertices?value=(i,318)&key=pid

    在本期进一步讨论:

    https://github.com/espeed/bulbs/issues/156

    【讨论】:

      猜你喜欢
      • 2012-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-27
      • 2013-02-26
      • 1970-01-01
      • 1970-01-01
      • 2012-11-16
      相关资源
      最近更新 更多