In this case you could just replace "lte" with "lt" if I'm not wrong. Otherwise you have to wait for someone other to answer.
Am Donnerstag, 9. April 2015 16:53:33 UTC+2 schrieb James Crone: > > I have try but same problem. I think this add +1 in date because when i > try date b/w 2015-03-01 to 2015-03-08 then it return null. and when i try > 2015-03-10 it returns data of 2015-03-10 and 2015-03-11 too. What You say? > > On Thursday, April 9, 2015 at 7:44:51 PM UTC+5, Jan Wolf wrote: >> >> Hmmm strange. Well I if you don't need scoring you should also use >> filters instead of queries. Try this one (works for me): >> >> "query" : { >> "filtered" : { >> "query" : { >> "query_string" : { >> "query" : "*" >> } >> }, >> "filter" : { >> "bool" : { >> "must" : { >> "range" : { >> "DateTime" : { >> "gt" : "....", >> "lte" : "...." >> } >> } >> } >> } >> } >> } >> } >> >> Am Donnerstag, 9. April 2015 15:27:08 UTC+2 schrieb James Crone: >>> >>> Same problem. :( >>> >>> On Thursday, April 9, 2015 at 6:25:25 PM UTC+5, Jan Wolf wrote: >>>> >>>> I would try "must" instead of "should" :) >>>> >>>> Am Dienstag, 7. April 2015 10:55:01 UTC+2 schrieb James Crone: >>>>> >>>>> Hello! >>>>> >>>>> My query is this: >>>>> >>>>> GET _search >>>>> { >>>>> "query": { >>>>> "bool": { >>>>> "should": [ >>>>> { >>>>> "range": { >>>>> "DateTime": { >>>>> "gt": "2015-03-01", >>>>> "lte": "2015-03-09" >>>>> } >>>>> } >>>>> } >>>>> ] >>>>> } >>>>> } >>>>> } >>>>> Result is: >>>>> >>>>> { >>>>> "took": 2, >>>>> "timed_out": false, >>>>> "_shards": { >>>>> "total": 11, >>>>> "successful": 11, >>>>> "failed": 0 >>>>> }, >>>>> "hits": { >>>>> "total": 1, >>>>> "max_score": 1, >>>>> "hits": [ >>>>> { >>>>> "_index": "completedata", >>>>> "_type": "users", >>>>> "_id": "1", >>>>> "_score": 1, >>>>> "_source": { >>>>> "ID": 1, >>>>> "User_ID": 1, >>>>> "Name": "Saudia Arabia Bomb", >>>>> "Text": "Saudia Arabia Bomb", >>>>> "Status": "online", >>>>> "DateTime": "2015-03-10T00:00:00.000+05:00", >>>>> "categories_ID": 1 >>>>> } >>>>> } >>>>> ] >>>>> } >>>>> } >>>>> >>>>> mapping for date is: >>>>> >>>>> "DateTime" : { >>>>> "type" : "date", >>>>> "format" : "dateOptionalTime" >>>>> } >>>>> >>>>> It returns me the result of "2015-03-10".How can i get exact result by >>>>> matching Date? Any Idea? >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b2271a25-bc00-4224-8695-c21aac8c8399%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.