我正在使用工作室的 OrientDB 2.0。我使用文档中的代码成功创建了 Lucene 空间索引:
CREATE class Place extends V
CREATE property Place.name string
CREATE property Place.latitude double
CREATE property Place.longitude double
CREATE INDEX Place.l_lon ON Place(latitude,longitude) SPATIAL ENGINE LUCENE
然后我创建了一些Place
对象与latitude
and longitude
.
当我尝试使用记录的格式进行空间搜索时
select from Class where [<lat-field>,<long-field>] NEAR [<x>,<y>]
搜索完成时没有错误,但没有返回任何结果,即使我传入其中之一的精确坐标也是如此Place
对象。
我还尝试直接使用查询索引
select from index:Place.l_lon
它也成功且没有错误,但没有返回任何结果。我想我的索引可能是空的。我尝试从模式编辑器重建它,但仍然没有结果。另外,据我所知,无法手动将位置坐标等复合条目添加到索引中。我错过了什么吗?