1

I am using "stratio cassandra-lucene-index" plugin for making spatial queries to cassandra below is my query which i am making from cqlsh and is working fine,

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}}');

My Question is How can i make this above query from Node.js, I am using cassandra-driver for other queries, Any suggestion is appreciated.

gasparms
  • 3,336
  • 22
  • 26
spider1983
  • 1,098
  • 1
  • 7
  • 14

1 Answers1

2

Since cassandra 3.x, secondary index query syntax changed from:

SELECT * from table where lucene='query';

to:

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

But no one else has adopted this query type yet (spark-cassandra connector...). So we still allow old style query syntax.

References: Alternative syntaxes

Eduardo Alonso
  • 233
  • 1
  • 5