Raven 似乎为 DateTime 生成了不正确的 Lucene 查询 [英] Raven appears to generate incorrect Lucene query for DateTime

查看:30
本文介绍了Raven 似乎为 DateTime 生成了不正确的 Lucene 查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Raven 中存储了一些文档,它们具有 CreationDate 属性,类型为DateTimeOffset".我一直试图从 C# 的查询中返回这些文档,如果我在查询条件中使用 CreationDate,它们永远不会返回.

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.

看了Raven控制台后,看到发出的查询是:

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})

我直接针对 HTTP 运行此查询,并将日期格式更改为:

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})

现在它可以工作了 - 它返回我的文档,这些文档绝对在该范围内.Raven 是否为 lucene 生成了错误的日期格式?如果是这样,我该如何解决这个问题?

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?

注意事项:

  1. 是的,我需要时区支持
  2. 是的,我的索引中需要时间和日期.

谢谢

呃......我只是将我的实体更改为使用DateTime,只是为了咯咯笑......但它仍然无法返回数据......这是怎么回事???我使用的是 RavenDB.Server.1.2.2002-Unstable

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,您正在将 RavenDB Server 1.2 预发布位与 RavenDB Client 1.0 Stable 一起使用.这些是不相容的.

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

这篇关于Raven 似乎为 DateTime 生成了不正确的 Lucene 查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆