Raven appears to generate incorrect Lucene query for DateTime

微笑、不失礼 提交于 2019-12-13 19:21:33

问题


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.



来源:https://stackoverflow.com/questions/10746833/raven-appears-to-generate-incorrect-lucene-query-for-datetime

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!