Re: including self-joins in parent/child queries

2014-12-18 Thread Michael Sokolov
Nice example, Greg; yes I can see how this can all become a little bewildering if you mix documents of different types having the same field. Keeping in mind that types are not really represented in the index, but are really just mental constructs we impose, it's not all that surprising they d

Re: including self-joins in parent/child queries

2014-12-17 Thread Gregory Dearing
Michael, I think I understand your point. I should mention that I'm just a user of BlockJoin... a year ago, I was doing the same tests you are now and was just trying to share my observations. :) I think either rule would be reasonable, but probably prefer that it throws exception... this helps

Re: including self-joins in parent/child queries

2014-12-16 Thread Michael Sokolov
Looking at the code, there are explicit checks for if (childId == parentId) throw an exception ... It seems to me that instead, the logic *could* be if (childId == parentId) then --- accumulate the parentId as if it were a child *and* terminate the block. In your phraseology, we could change

Re: including self-joins in parent/child queries

2014-12-16 Thread Gregory Dearing
Michael, Note that the index doesn't contain any special information about block-join relationships... it uses a convention that child docs are indexed before parent docs (ie. the root doc in each hierarchy has the largest docId in its block). This means that it can 'join' to parents just by comp

Re: including self-joins in parent/child queries

2014-12-16 Thread Michael Sokolov
OK - I see looking at the code that an exception is thrown if a parent doc matches the subquery -- so that explains what will happen, but I guess my further question is -- is that necessary? Could we just not throw an exception there? -Mike On 12/16/2014 10:38 AM, Michael Sokolov wrote: I se

including self-joins in parent/child queries

2014-12-16 Thread Michael Sokolov
I see in the docs of ToParentBlockJoinQuery that: * The child documents must be orthogonal to the parent * documents: the wrapped child query must never * return a parent document. First, it would be helpful if the docs explained what would happen if that assumption were violated. Second,