Java 在Neo4j中批量插入期间的数字索引

Java 在Neo4j中批量插入期间的数字索引,java,indexing,numeric,neo4j,batch-insert,Java,Indexing,Numeric,Neo4j,Batch Insert,我正在使用将节点和关系批量插入到Neo4j图形数据库中。一切正常,包括多个属性[String]name、[int]id上的索引。但是,当我尝试按范围查询属性id上的索引时,它不会返回任何结果 我从中得出的问题是,我不能像下面这样为BatchInserterIndex提供数值上下文: 您使用的是哪个版本的neo4j?它在最新版本中工作版本是最新的neo4j-community-1.4.1。您确定通过使用批插入索引获得范围结果吗?如果是这样的话,你能更具体一点吗?您成功地将ValueContext传

我正在使用将节点和关系批量插入到Neo4j图形数据库中。一切正常,包括多个属性[String]name、[int]id上的索引。但是,当我尝试按范围查询属性id上的索引时,它不会返回任何结果

我从中得出的问题是,我不能像下面这样为BatchInserterIndex提供数值上下文:


您使用的是哪个版本的neo4j?它在最新版本中工作

版本是最新的neo4j-community-1.4.1。您确定通过使用批插入索引获得范围结果吗?如果是这样的话,你能更具体一点吗?您成功地将ValueContext传递给批插入器索引了吗?您可以看看测试:,它看起来非常相似,并且通过了。是的,它通过了。我将在帖子中附加我的错误描述。谢谢
Map<String, Object> properties = new HashMap<String, Object>(2);

properties.put("name", urs.getString(1));

// I can do this:
properties.put("id", urs.getInt(2));

// But not this (throws an "invalid type" exception):
// properties.put("id", new ValueContext( urs.getInt(2) ).indexNumeric());

long node_id = inserter.createNode(properties);
index.add(node_id, properties);
IndexManager index = gdb.index();
Index<Node> people = index.forNodes("people");
IndexHits<Node> hits = people.query(
    QueryContext.numericRange("id", min_id, max_id)
  );
Long value = 1L;

long node_id = inserter.createNode(
  MapUtil.map("id", value, "other_prop", other_value));

index.add(node_id,
  MapUtil.map("id", ValueContext.numeric( value ), "other_prop", other_value));