3

如果我启用自动索引例如latitudelongitude字段(类型:)double我不能做这个查询

autoIndex.query(
            QueryContext.numericRange(
                    'longitude',
                    16.598145,
                    46.377254
            )
    );

autoIndex定义为graphDb.index().getNodeAutoIndexer().getAutoIndex()
简单地说,结果大小是size=0


其他查询如

autoIndex.get(...)

或者

autoIndex.query('id', new QueryContext("*").sort(sort))

工作得很好。


locations_index但是,如果我手动添加索引

    ValueContext latValue = new ValueContext(node.getProperty('latitude')).indexNumeric();
    ValueContext lonValue = new ValueContext(node.getProperty('longitude')).indexNumeric();

    locationsIndex.add(node, 'latitude', latValue);
    locationsIndex.add(node, 'longitude', lonValue);

对于数据库中的每个纬度/经度,查询都有效。

我的问题是 - 有没有办法自动将数字字段索引为ValueContext.indexNumeric()?不应该是自动的吗?

4

0 回答 0