Raven appears to generate incorrect Lucene query f

2019-08-01 05:10发布

问题:

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:

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



标签: ravendb