query between two date
Hi there, At first i have to explain the situation. I have 2 fields indexed named tdm_avail1 and tdm_avail2 that are arrays of some different dates. "This is a sample doc" 2010-10-21T08:29:43Z 2010-10-22T08:29:43Z 2010-10-25T08:29:43Z 2010-10-26T08:29:43Z 2010-10-27T08:29:43Z 2010-10-19T08:29:43Z 2010-10-20T08:29:43Z 2010-10-21T08:29:43Z 2010-10-22T08:29:43Z And in my search form i have 2 field named check-in date and check-out date. I want solr to compare the range that user enter in the search form with the values of tdm_avail1 and tdm_avail2 and return doc if all dates between check-in and check-out dates matches with tdm_avail1 or tdm_avail2 values. for example if user enter: check-in date: 2010-10-19 check-out date: 2010-10-21 that is match with tdm_avail2 then doc must be returned. but if user enter: check-in date: 2010-10-25 check-out date: 2010-10-29 doc could not be returned. so i want the query that gives me the mentioned result. could you help me please? thanks in advance -- View this message in context: http://lucene.472066.n3.nabble.com/query-between-two-date-tp1718566p1718566.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: query between two date
Thanks for your reply. I know about the solr date format!! Check-in and Check-out dates are user-friendly format that we use in our search form for system's users. and i change the format via code and then send them to solr. I want to know how can i make a query to compare a range between check-in and check-out date with some separate different days that i have in solr index. for example: check-in date is: 2010-10-19T00:00:00Z and check-out date is: 2010-10-21T00:00:00Z when i want to build a query from my application i have a range date but in solr index i have separate dates. So how can i compare them to get the appropriate result? -- View this message in context: http://lucene.472066.n3.nabble.com/query-between-two-date-tp1718566p1723752.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: query between two date
The exact query that i want is: check-in date >= 2010-10-19T00:00:00Z AND check-out date <= 2010-10-21T00:00:00Z but because of the structure that i have to index i don't have specific start date and end date in my solr index to compare with check-in and check-out date range. I have some dates that available to reserve! Could you please help me? :) -- View this message in context: http://lucene.472066.n3.nabble.com/query-between-two-date-tp1718566p1724062.html Sent from the Solr - User mailing list archive at Nabble.com.