0

I'm new to DSE. Working on DSE based queries to get date range

1) select count(1) from tbl where solr_query='code:maf'; It gives the result.

But When I'am trying to use range query is gives error :-

select count(1) from tbl where solr_query='{q:dt:[ 2017-11-15T10:12:10 TO 2017-11-15T12:10:10Z] }';

Error :- Invalid Request: Error from Server: Code:2200 [Invalid Query] message="Cannot pass JSON query" '{q:dt:[ 2017-11-15T10:12:10 TO 2017-11-15T12:10:10Z] }'

Where I'am going wrong? Please help

Thanks,

Saif Ahmad
  • 1,118
  • 1
  • 8
  • 24
jAi
  • 115
  • 1
  • 14

1 Answers1

1

you need correctly format your query - it should be JSON inside, like this:

select count(1) from tbl where 
  solr_query='{"q":"dt:[ 2017-11-15T10:12:10 TO 2017-11-15T12:10:10Z]"}';

See official documentation for detailed description.

Alex Ott
  • 80,552
  • 8
  • 87
  • 132