Field Not Indexed Exception

26 views
Skip to first unread message

David Brower

unread,
Aug 28, 2015, 5:44:43 AM8/28/15
to RavenDB - 2nd generation document database
I should probably have asked this question here: RavenDB: Field Not Indexed Exception

We're currently evaluating RavenDB in a POC application and have hit a blocker. When I run a query against the index in the Raven Studio then I get the results I want but when I query against it from C# then I get an Index not found exception.

When 













Oren Eini (Ayende Rahien)

unread,
Aug 28, 2015, 5:48:59 AM8/28/15
to ravendb
Are you actually specifying the index to use in the C# query?
Also note that a _much_ better way to specify this index is:

from job in docs.Jobs
select new
{
  Stages_AssignedAgents_Id = job.Stages.SelectMany(x=>x.AssignedAgents).Select(x=>x.Id)
}



Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Marisic

unread,
Aug 28, 2015, 10:44:58 AM8/28/15
to RavenDB - 2nd generation document database


On Friday, August 28, 2015 at 4:48:59 AM UTC-5, Oren Eini wrote:
Are you actually specifying the index to use in the C# query?
Also note that a _much_ better way to specify this index is:

from job in docs.Jobs
select new
{
  Stages_AssignedAgents_Id = job.Stages.SelectMany(x=>x.AssignedAgents).Select(x=>x.Id)
}



This concept in raven is totally unintuitive. Something needs to be done to make this concept more obvious and better explained. It's very easy for people to get lost trying to query nested objects

Oren Eini (Ayende Rahien)

unread,
Aug 28, 2015, 12:02:13 PM8/28/15
to ravendb

Chris Marisic

unread,
Aug 28, 2015, 1:00:25 PM8/28/15
to RavenDB - 2nd generation document database
Documented != intuitive 

Oren Eini (Ayende Rahien)

unread,
Aug 28, 2015, 1:20:20 PM8/28/15
to ravendb
Not all complex problems can be made initiative without actually going through and understanding the scope within they work

Chris Marisic

unread,
Aug 28, 2015, 1:28:22 PM8/28/15
to RavenDB - 2nd generation document database
I don't believe that for a minute. User Experience is hard, never impossible.

David Brower

unread,
Aug 28, 2015, 5:34:56 PM8/28/15
to RavenDB - 2nd generation document database
Thanks, Oren.

I realise now that I need to be able to filter a job document on both the status of a stage as well as the agentid. This works:

            Map = jobs => from job in jobs
                select new
                {
                    Stages_AssignedAgents_Id = job.Stages
                                                    .SelectMany(x => x.AssignedAgents)
                                                        .Select(x => x.Id),
                    Stages_Status = job.Stages.Select(x => x.Status)
                };

But is that good practice? Although, I guess in some ways this is now more of a LINQ question.

Oren Eini (Ayende Rahien)

unread,
Aug 29, 2015, 5:35:26 AM8/29/15
to ravendb
Yes, that works, and that is great.

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


Reply all
Reply to author
Forward
0 new messages