1

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

Adam
  • 4,159
  • 4
  • 32
  • 53
  • 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 May 25 '12 at 02:32
  • Are you using the same version of Client and Server? – Matt Warren May 25 '12 at 08:42
  • Actually, No, I was using the latest stable client... is that likely to have been the problem? – Adam May 25 '12 at 08:56
  • 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 May 25 '12 at 11:35

1 Answers1

1

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

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41