1
votes

I have some documents stored in Raven, which have a CreationDate property, of type "DateTimeOffset". I have been attempting to get these documents returned in a query from C#, and they are never returned if I use the CreationDate in the query criteria.

After watching the Raven console, I saw the query being issued was:

        Query: (FeedOwner:25eb541c\-b04a\-4f08\-b468\-65714f259ac2) AND ( Creati
onDate:[20120524120000000 TO NULL] AND CreationDate:{* TO 20120525120000000})

I ran this query directly against HTTP, and changed the date format to:

        Query: (FeedOwner:25eb541c\-b04a\-4f08\-b468\-65714f259ac2) AND ( Creati
onDate:[2012-05-24120000000 TO NULL] AND CreationDate:{* TO 2012-05-25120000000})

And now it works - it returns my documents which DEFINITELY fall within the range. Is Raven generating the incorrect date format for lucene? If so, how do I fix this?

Notes:

  1. Yes I need time zone support
  2. Yes I need Time aswell as Date in my index.

Thanks

[EDIT] Err... I just changed my entities to use DateTime, just for giggles... and it still fails to return the data... whats going on??? Im using RavenDB.Server.1.2.2002-Unstable

1
I have rolled the server back to "RavenDB 1.0.910-Unstable" and it the exact same query, yields results... So there is something wrong with the latest (unstable) Raven Server - Adam
Are you using the same version of Client and Server? - Matt Warren
Actually, No, I was using the latest stable client... is that likely to have been the problem? - Adam
I think so, try using the same version of client and server. Build 1.2.XXX is a new version and I think there were some breaking changes regarding how dates are used, - Matt Warren

1 Answers

1
votes

Adam, You are using RavenDB Server 1.2 pre release bits with the RavenDB Client 1.0 Stable. Those are incompatible.