Linq 对象类型上的raven查询引发异常

Linq 对象类型上的raven查询引发异常,linq,ravendb,Linq,Ravendb,文件结构: class UserAccountInfo { public String Id { get; set; } public AccountType AccountType { get; set; }Servicetax public String MainAccountMobileNo { get; set; } public UserStatus Status { get; set; } public Strin

文件结构:

class UserAccountInfo
{
       public String Id { get; set; }
       public AccountType AccountType { get; set; }Servicetax
       public String MainAccountMobileNo { get; set; }
       public UserStatus Status { get; set; }
       public String EmailId { get; set; }
       public String DisplayName { get; set; }
       **public Object User { get; set; }**
}
对象存储帐户类型中提到的任何类型的实例。使用AccountType for ex可以找到存储在对象中的类型;如果Accountype是customer,那么对象中存储的实例将是AccountinfoCustomer,依此类推。因此,我尝试使用它进行查询,但从raven获得以下异常

var Result = sess.Query<UserAccountInfo>().Where(x => x.AccountType == usertype && ((AccountInfoCustomer)x.User).Customerstatus == CustomerStatus.Pending);
var Result=sess.Query()。其中(x=>x.AccountType==usertype&((AccountInfoCustomer)x.User)。Customerstatus==Customerstatus.Pending);

{“Url:\”/index/dynamic/UserAccountInfos?query=AccountType%253ADistributor%2520和%2520User)。Customerstatus%253APending&start=0&pageSize=128&aggregation=None\“\r\n\r\nSystem.ArgumentException:字段“)\u Customerstatus”未编制索引,无法查询Raven.Database.Indexing.Index.IndexQueryOperation.AssertQueryDoesNotContainFieldsThatAreNotIndexes()上未编制索引的字段。\r\n这应该可以工作。在当前稳定的RavenDB 2.0.2230中测试

此处的测试:


您使用的是旧版本吗?

Matt。我已将版本更改为最新版本2.0.2230。这对我来说仍然不起作用。我得到的异常是。[System.InvalidOperationException]={“Url:\”/indexes/dynamic/UserAccountInfos?query=User]。Customerstatus%253APending&start=0&pageSize=128&aggregation=None\"\r\n\r\nLucene.Net.QueryParsers.ParseException:无法解析:'User'。Customerstatus:Pending'-->Lucene.Net.QueryParsers.ParseException…是否有任何特定的库,您已经添加以执行此查询。抱歉,Matt..这是我的错误,我没有更新raven客户端库,这就是问题的原因。现在它正在工作ks