Range search using solr_query

363 views
Skip to first unread message

Saurabh naik

unread,
Feb 3, 2016, 11:20:01 AM2/3/16
to DataStax Java Driver for Apache Cassandra User Mailing List

Hi All,

                We are trying to pull data from cassandra-solr node with date ranges using solr query.

e.g.

SELECT *  FROM keyspace_name.table_name where solr_query='{"q":"<col1>:*",,"sort":"col1 asc"}';

                I could find syntax for apache solr documentation to perform range search & examples too.


In case of Datastax Solr DSE search syntax for multiple conditions/date filters is not available  


https://docs.datastax.com/en/datastax_enterprise/4.6/datastax_enterprise/srch/srchCql.html


I couldn’t find any documentation for Datastax Solr for following things specifically.

  1)       “fq” with multiple parameters

2)            Syntax for date ranges.

  Date formats


Please let me know if i can refer to any source other than Datastax Solr documentation for syntax & examples for firing query with parameters as to find data between two dates

Equivalent cql query:

select * from tableName where startdate >= '1987-19-09 11:14:00+0000' AND  startdate < '2003-10-06 08:42:00+0000' limit 500 allow filtering;


 


Please help.

 Thanks

Saurabh

Jack Krupansky

unread,
Feb 3, 2016, 11:34:40 AM2/3/16
to java-dri...@lists.datastax.com
(Technically this is not a question about the Cassandra Java driver, but...)

It's simply straight Solr query syntax, like:

startdate:[1987-19-09T11:14:00 TO 2003-10-06T08:42:00}

Note that time is GMT in Solr.

Square brackets denote inclusive and curly braces denote exclusive.

Ditto for the "fq" parameter. In DSE it will either be a single string or a JSON array of strings.

Doc:


-- Jack Krupansky

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Saurabh naik

unread,
Feb 4, 2016, 4:26:06 AM2/4/16
to java-dri...@lists.datastax.com
Hi Jack,
Thanks for quick response.
My query is resolved, Thanks a lot.
We are running these queries on cql shell to validate data before we use them in our application code.

Just wanted to ask where do we get information on timezones supported in solr_query.
I have found some links:
Not sure about which docs to refer for datastax solr.

Regards,
Saurabh








--
-
सदियो रहा है दुश्मन दौर-ए-जमान हमारा । कुछ बात है की हस्ती मिटती नही हमारी

Jack Krupansky

unread,
Feb 4, 2016, 8:43:09 AM2/4/16
to java-dri...@lists.datastax.com
No time zone support - all times in Solr are GMT. I did forget to put the "Z" (for Zulu/GMT) after each date in my example.

-- Jack Krupansky
Reply all
Reply to author
Forward
0 new messages