If I modify the query like this:

{!parent which='class:instruction'}class:observation

It still returns a result for the instruction document, even though the 
document with class instruction does not have any children...

Tor-Magne Stien Hagen

-----Original Message-----
From: Mikhail Khludnev <m...@apache.org> 
Sent: Wednesday, June 24, 2020 2:14 PM
To: solr-user <solr-user@lucene.apache.org>
Subject: Re: Unexpected results using Block Join Parent Query Parser

Jan, thanks for the clarification.
Sure you can use {!parent which=class:section} for return children, which has a 
garndchildren matching subordinate query.
Note: there's something about named scopes, which I didn't get into yet, but it 
might be relevant to the problem.

On Wed, Jun 24, 2020 at 1:43 PM Jan Høydahl <jan....@cominvent.com> wrote:

> I guess the key question here is whether «parent» in BlockJoin is 
> strictly top-level parent/root, i.e. class:composition for the example 
> in this tread? Or can {!parent} parser also be used to select the 
> «child» level in a child/grandchild relationship inside a block?
>
> Jan
>
> > 24. jun. 2020 kl. 11:36 skrev Tor-Magne Stien Hagen <t...@dips.no>:
> >
> > Thanks for your answer,
> >
> > What kind of rules exists for the which clause? In other words, how 
> > can
> you identify parents without using some sort of filtering?
> >
> > Tor-Magne Stien Hagen
> >
> > -----Original Message-----
> > From: Mikhail Khludnev <m...@apache.org>
> > Sent: Wednesday, June 24, 2020 10:01 AM
> > To: solr-user <solr-user@lucene.apache.org>
> > Subject: Re: Unexpected results using Block Join Parent Query Parser
> >
> > Hello,
> >
> > Please check warning box titled Using which
> >
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fluce
> ne.apache.org%2Fsolr%2Fguide%2F8_5%2Fother-parsers.html%23block-join-p
> arent-query-parser&amp;data=02%7C01%7Ctsh%40dips.no%7C9201c7db5ed34baf
> 864808d818383e50%7C2f46c9197c11446584b2e354fb809979%7C0%7C0%7C63728597
> 7131631165&amp;sdata=0kMYuLmBcziHdzOucKA7Vx63Xr7a90dqOsplNteRbvE%3D&am
> p;reserved=0
> >
> > On Wed, Jun 24, 2020 at 10:01 AM Tor-Magne Stien Hagen <t...@dips.no>
> wrote:
> >
> >> Hi,
> >>
> >> I have indexed the following nested document in Solr:
> >>
> >> {
> >>    "id": "1",
> >>    "class": "composition",
> >>    "children": [
> >>        {
> >>            "id": "2",
> >>            "class": "section",
> >>            "children": [
> >>                {
> >>                    "id": "3",
> >>                    "class": "observation"
> >>                }
> >>            ]
> >>        },
> >>        {
> >>            "id": "4",
> >>            "class": "section",
> >>            "children": [
> >>                {
> >>                    "id": "5",
> >>                    "class": "instruction"
> >>                }
> >>            ]
> >>        }
> >>    ]
> >> }
> >>
> >> Given the following query:
> >>
> >> {!parent which='id:4'}id:3
> >>
> >> I expect the result to be empty as document 3 is not a child 
> >> document of document 4.
> >>
> >> To reproduce, use the docker container provided here:
> >> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fg
> >> ith 
> >> ub.com%2Ftormsh%2FSolr-Example&amp;data=02%7C01%7Ctsh%40dips.no%7C5
> >> fef 
> >> 4e9a68cc41c72fd208d81814e93e%7C2f46c9197c11446584b2e354fb809979%7C0
> >> %7C 
> >> 0%7C637285825378470570&amp;sdata=OyjBalFeXfb0W2euL76L%2BNyRDg9ukvT8
> >> TNI
> >> aODCmV30%3D&amp;reserved=0
> >>
> >> Have I misunderstood something regarding the Block Join Parent 
> >> Query Parser?
> >>
> >> Tor-Magne Stien Hagen
> >>
> >>
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
>
>

--
Sincerely yours
Mikhail Khludnev

Reply via email to