You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Bhawani Sharma <bh...@aol.com> on 2008/12/30 09:13:03 UTC

Date Range query in Solr

Hi all,
what will be the syntex of this sql query 
SELECT * FROM table WHERE date <= CURRENT_DATE

in solr format ?


Thanks in advance.

Regards:
Bhawani Sharma
-- 
View this message in context: http://www.nabble.com/Date-Range-query-in-Solr-tp21214216p21214216.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Date Range query in Solr

Posted by Chris Hostetter <ho...@fucit.org>.
:       I too have a similar question on getting the query results based on
: dateRange. I have both startDate and endDate fields in my schema and if I
: want to get the query results that fall into two date values for eg: get all
: the docs. whose date is between startDate and endDate, then how can I query.

searching the mailing list archive is always a good place to start...

http://www.nabble.com/forum/Search.jtp?forum=14479&local=y&query=startDate+endDate

http://www.nabble.com/Date-Range-Query-%2B-Fields-to16108517.html#a16132427




-Hoss


Re: Date Range query in Solr

Posted by Rayudu <av...@yahoo.co.in>.
Hi, 
      I too have a similar question on getting the query results based on
dateRange. I have both startDate and endDate fields in my schema and if I
want to get the query results that fall into two date values for eg: get all
the docs. whose date is between startDate and endDate, then how can I query.

Thanks,
Rayudu.



Shalin Shekhar Mangar wrote:
> 
> There is no table in Solr -- all fields are in the same schema.
> 
> For the date you can try using the following as the 'q' parameter:
> date:[* TO NOW]
> 
> On Tue, Dec 30, 2008 at 1:43 PM, Bhawani Sharma
> <bh...@aol.com>wrote:
> 
>>
>> Hi all,
>> what will be the syntex of this sql query
>> SELECT * FROM table WHERE date <= CURRENT_DATE
>>
>> in solr format ?
>>
>>
>> Thanks in advance.
>>
>> Regards:
>> Bhawani Sharma
>> --
>> View this message in context:
>> http://www.nabble.com/Date-Range-query-in-Solr-tp21214216p21214216.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Regards,
> Shalin Shekhar Mangar.
> 
> 

-- 
View this message in context: http://www.nabble.com/Date-Range-query-in-Solr-tp21214216p21354592.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Date Range query in Solr

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
There is no table in Solr -- all fields are in the same schema.

For the date you can try using the following as the 'q' parameter:
date:[* TO NOW]

On Tue, Dec 30, 2008 at 1:43 PM, Bhawani Sharma <bh...@aol.com>wrote:

>
> Hi all,
> what will be the syntex of this sql query
> SELECT * FROM table WHERE date <= CURRENT_DATE
>
> in solr format ?
>
>
> Thanks in advance.
>
> Regards:
> Bhawani Sharma
> --
> View this message in context:
> http://www.nabble.com/Date-Range-query-in-Solr-tp21214216p21214216.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


-- 
Regards,
Shalin Shekhar Mangar.