Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:37:00+00:00 2026-06-18T04:37:00+00:00

document Structure: class UserAccountInfo { public String Id { get; set; } public AccountType

  • 0

document Structure:

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; }**
}

object stores instance of any type that is mentioned in Account type. the type that is stored in the object can be found using Accountype for ex; if Accountype is customer then instance stored in the object will be AccountinfoCustomer and so on. So using that I’ve tried to query but getting the following exception from raven.

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

{“Url: \”/indexes/dynamic/UserAccountInfos?query=AccountType%253ADistributor%2520AND%2520User).Customerstatus%253APending&start=0&pageSize=128&aggregation=None\”\r\n\r\nSystem.ArgumentException: The field ‘)_Customerstatus’ is not indexed, cannot query on fields that are not indexed\r\n at Raven.Database.Indexing.Index.IndexQueryOperation.AssertQueryDoesNotContainFieldsThatAreNotIndexes()

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:37:02+00:00Added an answer on June 18, 2026 at 4:37 am

    This should work. Tested in current stable RavenDB 2.0.2230.

    Tests here: https://gist.github.com/4692351

    Are you on an older version?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something that looks like the following document structure: public class Document {
Lets say we have the following document structure: class BlogPost { [MongoIdentifier] public Guid
Say I have the given document structure in RavenDb public class Car { public
I have the following structure: class User include Mongoid::Document end class Resource include Mongoid::Document
Given this structure: <root> <user> <userName>user1</userName> <userImageLocation>/user1.png</userImageLocation> </user> <user> <userName>user2</userName> </user> </root> public class
My class: public class Device { int ID; string Name; List<Function> Functions; } And
I have got this structure class House include Mongoid::Document embeds_many :inhabitants end class Inhabitant
I have the following model: class Entry include Mongoid::Document field :title, type: String field
I have a document structure {'text': 'here is text', 'count' : 13, 'somefield': value}
I have a given XML document (structure can not be changed) and want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.