我正在使用“分层卡桑德拉-卢塞尼索引”插件对cassandra进行空间查询,这是我从cqlsh所做的查询,运行良好,
SELECT * FROM user_location WHERE expr(user_location_index, '{filter:{type:"geo_distance", field:"place", latitude: 28.6076, longitude: 77.3683, max_distance:"20km"}, sort:{field: "place", type: "geo_distance", latitude: 28.6076, longitude: 77.3683}}');我的问题是如何从Node.js进行上述查询,我正在使用cassandra驱动程序进行其他查询,任何建议都将不胜感激。
发布于 2016-09-27 16:37:47
由于cassandra 3.x,次要索引查询语法更改为:
SELECT * from table where lucene='query';至:
SELECT * from table WHERE expr(index_name,'query');但是还没有其他人采用这种查询类型(星火-cassandra连接器.)。因此,我们仍然允许旧风格的查询语法。
参考资料:替代语法
https://stackoverflow.com/questions/39358705
复制相似问题