2016-09-06 35 views
1

我正在使用「stratio cassandra-lucene-index」插件進行空間查詢以下cassandra是我的查詢,我從cqlsh和做工精緻,他們的任何方式來使節點「stratio cassandra-lucene-index」查詢js

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的驅動程序爲其他查詢,任何建議表示讚賞。

回答

2

由於卡桑德拉3.x中,二級索引查詢語法改變從:

SELECT * from table where lucene='query'; 

到:

SELECT * from table WHERE expr(index_name,'query'); 

但是,沒有人已經採用了這種查詢類型,但(火花卡桑德拉連接器。 ..)。所以我們仍然允許使用舊式的查詢語法。

參考文獻:Alternative syntaxes