With NHibernate it would select by the discriminator, but I don't
understand how you would filter out with RavenDB.
Phill
On Dec 11, 9:26 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:
> Justin,
> Based on the blog post, it is working as expected.
> Raven-Clr-Type is a piece of metadata that is never actually used on the
> server, we are only ever using this on the client side.
> When you are are asking to get all the Dogs which have the entity name
> "Animals" (which is effectively what you are doing), you are going to get
> an error, because you don't filter our the cats.
>
>
>
>
>
>
>
> On Sat, Dec 10, 2011 at 3:27 PM, Justin A <jus...@adler.com.au> wrote:
> > Hi folks,
>
> > A question was asked @ JabbR (http://jabbr.net/#/rooms/RavenDB) about how
> > to retrieve a list of polymorphic documents. Seemed simple, but a run time
> > error kept occuring. He even made a blog post about it:
> >http://www.philliphaydon.com/2011/12/ravendb-inheritance/
>
> > The run time error was that when we asked for a list of Animals (assume
> > Animals are the parent abstract class) .. we got the list of concretes. But
> > if we just wanted a list of concretes (eg. Cats .. not cats and dogs) then
> > we got a runtime error.
>
> > Now, I've created a Repo of this here:http://pastie.org/2995779
>
> > We're not sure what we've done wrong.
>
> > I was also referencing this blog post:
> >http://groups.google.com/group/ravendb/browse_thread/thread/9fe0ccd9f...
> > And also this once about a possible bug .. which has been fixed already??
> > :
> >http://groups.google.com/group/ravendb/browse_thread/thread/3c57553f8...
Well you solved all my problems last night during the screen cast. I'm
going to write up a blog post with what I was trying to do and with
the solution. Then I'll link it back in this thread so if someone else
finds this it may help them.
Cheers.
Phill
On Dec 11, 10:08 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:
> Phillip,
> You _have_ a discriminator, that is what the Raven-Entity-Name is for :-)
> You decided to make them both the same thing.
>
> Let us take several steps back, what is it that you are actually trying to
> _do_?
>
Updated blog post from the original.
Phill
On Dec 12, 10:58 pm, "Oren Eini (Ayende Rahien)" <aye...@ayende.com>
wrote:
> Awesome
I didn't actually show it in the blog post, but I was playing around a
little bit with querying. One of the things I did was change the index
like so:
public class All_Content : AbstractMultiMapIndexCreationTask<Content>
So I've specified the type on the index, I used 'Content' but you
could have a class unrelated to mapped documents, and use something
that just specifies the mapped properties.
Then included an index property line within the constructor:
Indexes.Add(x => x.Title, FieldIndexing.Analyzed);
Then was using things like:
var result = session.Advanced.LuceneQuery<Content, All_Content>()
.Where("Title: article")
.ToList();
And it returned me a list of objects with 'article' written in the
title.
I plan on doing some blog posts in the future when I learn more about
searching and such.
Phill
On Dec 14, 4:31 am, spokeypokey <jeffrey.p.bern...@gmail.com> wrote:
> Thanks so much for the blog post. It was wonderfully clear and concise.
>
> I have a question, though, about the following line in the post:
> ]
> "The really interesting thing I found is that if I look at what’s returned
> ... Are the correct CLR types that I originally defined. So I haven’t lost
> all the additional fields by not defining them. I’m still learning but* for
> now I assume it allows those fields to be searchable*."