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 6621305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:14:46+00:00 2026-05-25T21:14:46+00:00

sssI currently have an index called SchoolMetrics that aggregates several fields on the School

  • 0

sssI currently have an index called SchoolMetrics that aggregates several fields on the School field as the key and produces documents like this:

{ 
    School: {
      SchoolId: 1234
      Name: "asdf"
    }
    StudentCount: 1234,
    CourseCount: 1234
 }

My index map is defined as:

from s in docs.Metrics
where s.School != null
select new
{
    s.School,
    s.StudentCount,
    s.CourseCount
}

And the reduce is:

from s in results
group s by s.School
into g
select new
{
    School= g.Key,
    StudentCount = g.Sum(x => x.StudentCount),
    CourseCount = g.Sum(x => x.CourseCount)
}

When I try to do a query such a:
http://localhost:8080/databases/Database/indexes/SchoolMetrics?query=School.SchoolId:1234

It gives me this error:

 "System.ArgumentException: The field 'School.SchoolId' is not indexed, cannot query on fields that are not indexed
   at Raven.Database.Indexing.Index.IndexQueryOperation.AssertQueryDoesNotContainFieldsThatAreNotIndexes() in c:\Builds\raven\Raven.Database\Indexing\Index.cs:line 639
   at Raven.Database.Indexing.Index.IndexQueryOperation.<Query>d__24.MoveNext() in c:\Builds\raven\Raven.Database\Indexing\Index.cs:line 558
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Raven.Database.DocumentDatabase.<>c__DisplayClass70.<Query>b__68(IStorageActionsAccessor actions) in c:\Builds\raven\Raven.Database\DocumentDatabase.cs:line 705
   at Raven.Storage.Esent.TransactionalStorage.ExecuteBatch(Action`1 action) in c:\Builds\raven\Raven.Storage.Esent\TransactionalStorage.cs:line 378
   at Raven.Storage.Esent.TransactionalStorage.Batch(Action`1 action) in c:\Builds\raven\Raven.Storage.Esent\TransactionalStorage.cs:line 341
   at Raven.Database.DocumentDatabase.Query(String index, IndexQuery query) in c:\Builds\raven\Raven.Database\DocumentDatabase.cs:line 652
   at Raven.Database.Server.Responders.Index.PerformQueryAgainstExistingIndex(IHttpContext context, String index, IndexQuery indexQuery, Guid& indexEtag) in c:\Builds\raven\Raven.Database\Server\Responders\Index.cs:line 150
   at Raven.Database.Server.Responders.Index.ExecuteQuery(IHttpContext context, String index, Guid& indexEtag) in c:\Builds\raven\Raven.Database\Server\Responders\Index.cs:line 136
   at Raven.Database.Server.Responders.Index.GetIndexQueryRessult(IHttpContext context, String index) in c:\Builds\raven\Raven.Database\Server\Responders\Index.cs:line 92
   at Raven.Database.Server.Responders.Index.OnGet(IHttpContext context, String index) in c:\Builds\raven\Raven.Database\Server\Responders\Index.cs:line 84
   at Raven.Database.Server.Responders.Index.Respond(IHttpContext context) in c:\Builds\raven\Raven.Database\Server\Responders\Index.cs:line 46
   at Raven.Http.HttpServer.DispatchRequest(IHttpContext ctx) in c:\Builds\raven\Raven.Http\HttpServer.cs:line 399
   at Raven.Http.HttpServer.HandleActualRequest(IHttpContext ctx) in c:\Builds\raven\Raven.Http\HttpServer.cs:line 222"

What’s weirder is that when I try querying on the StudentCount or CourseCount fields it works… I’ve tried adding an analyzer on the School.SchoolId field but that doesn’t seem to help… I’ve also tried flattening out the resulting document and I get the same error. Am I missing something?

  • 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-05-25T21:14:47+00:00Added an answer on May 25, 2026 at 9:14 pm

    In addition to Thomas’ note, you have to understand that we are looking at the final output from the index as the indexed item.
    And if you are indexing a complex object, it is going to be indexed as a Json value, not as something that you can query on further.

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

Sidebar

Related Questions

I have a few files like this- *.sss and *_passive.sss If I have a
Possible Duplicate: Regular Expression to match outer brackets I have a string of the
the method is: def printa(x): return x the response is: self.response.out.write(template.render(path, {'printa':printa})) the html
Having trouble determining if a file name conforms to a specific convention as follows.
the next is my code: class foo: def __init__(self): self.a = a def __getattr__(self,x,defalut):
I am working on mongodb . In which i Want to use like query.
Am doing a multiple insertion using foreach (there are two level of looping because
How can I get the following string readable? var sc = unescape( %u9090%u19eb%u4b5b%u3390%u90c9%u7b80%ue901%u0175%u66c3%u7bb9%u8004%u0b34%ue2d8%uebfa%ue805 %uffe2%uffff%u3931%ud8db%u87d8%u79bc%ud8e8%ud8d8%u9853%u53d4%uc4a8%u5375%ud0b0%u2f53%ud7b2
I'm guessing I'm missing something, but I can't seem to get this statement 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.