RE: Unexpected results using Block Join Parent Query Parser

2020-06-26 Thread Tor-Magne Stien Hagen
Alright, that solved the problem. Thank you very much!

Tor-Magne Stien Hagen

-Original Message-
From: Mikhail Khludnev  
Sent: Thursday, June 25, 2020 12:13 PM
To: solr-user 
Subject: Re: Unexpected results using Block Join Parent Query Parser

Ok. My fault. Old sport, you know. When retrieving  intermediate scopes, 
parents bitmask shout include all enclosing scopes as well. It's a dark side of 
the BJQ.
 {!parent which=`class:(section OR composition)`} I'm not 
sure what you try to achieve specifying grandchildren as a parent-bitmask. 
Note, the algorithm assumes that parents' bitmask has the last doc in the 
segment set. I.e. 'which' query supplied in runtime should strictly correspond 
to the block structure indexed before.

On Thu, Jun 25, 2020 at 12:05 PM Tor-Magne Stien Hagen  wrote:

> 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 
> Sent: Wednesday, June 24, 2020 2:14 PM
> To: solr-user 
> 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  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 :
> > >
> > > 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 
> > > Sent: Wednesday, June 24, 2020 10:01 AM
> > > To: solr-user 
> > > 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%2Flu
> > ce 
> > ne.apache.org%2Fsolr%2Fguide%2F8_5%2Fother-parsers.html%23block-join
> > -p 
> > arent-query-parserdata=02%7C01%7Ctsh%40dips.no%7C9201c7db5ed34b
> > af
> > 864808d818383e50%7C2f46c9197c11446584b2e354fb809979%7C0%7C0%7C637285
> > 97 
> > 7131631165sdata=0kMYuLmBcziHdzOucKA7Vx63Xr7a90dqOsplNteRbvE%3D&
> > am
> > p;reserved=0
> > >
> > > On Wed, Jun 24, 2020 at 10:01 AM Tor-Magne Stien Hagen 
> > > 
> > 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%2
> > >> Fg
> > >> ith
> > >> ub.com%2Ftormsh%2FSolr-Exampledata=02%7C01%7Ctsh%40dips.no%7
> > >> C5
> > >> fef
> > >> 4e9a68cc41c72fd208d81814e93e%7C2f46c9197c11446584b2e354fb809979%7
> > >> C0
> > >> %7C
> > >> 0%7C637285825378470570sdata=OyjBalFeXfb0W2euL76L%2BNyRDg9ukv
> > >> T8
> > >> TNI
> > >> aODCmV30%3Dreserved=0
> > >>
> > >> Have I misunderstood something regarding the Block Join Parent 
> > >> Query Parser?
> > >>
> > >> Tor-Magne Stien Hagen
> > >>
> > >>
> > >
> > > --
> > > Sincerely yours
> > > Mikhail Khludnev
> >
> >
>
> --
> Sincerely yours
> Mikhail Khludnev
>


--
Sincerely yours
Mikhail Khludnev


RE: Unexpected results using Block Join Parent Query Parser

2020-06-25 Thread Tor-Magne Stien Hagen
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  
Sent: Wednesday, June 24, 2020 2:14 PM
To: solr-user 
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  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 :
> >
> > 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 
> > Sent: Wednesday, June 24, 2020 10:01 AM
> > To: solr-user 
> > 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-parserdata=02%7C01%7Ctsh%40dips.no%7C9201c7db5ed34baf
> 864808d818383e50%7C2f46c9197c11446584b2e354fb809979%7C0%7C0%7C63728597
> 7131631165sdata=0kMYuLmBcziHdzOucKA7Vx63Xr7a90dqOsplNteRbvE%3D
> p;reserved=0
> >
> > On Wed, Jun 24, 2020 at 10:01 AM Tor-Magne Stien Hagen 
> 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-Exampledata=02%7C01%7Ctsh%40dips.no%7C5
> >> fef 
> >> 4e9a68cc41c72fd208d81814e93e%7C2f46c9197c11446584b2e354fb809979%7C0
> >> %7C 
> >> 0%7C637285825378470570sdata=OyjBalFeXfb0W2euL76L%2BNyRDg9ukvT8
> >> TNI
> >> aODCmV30%3Dreserved=0
> >>
> >> Have I misunderstood something regarding the Block Join Parent 
> >> Query Parser?
> >>
> >> Tor-Magne Stien Hagen
> >>
> >>
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
>
>

--
Sincerely yours
Mikhail Khludnev


RE: Unexpected results using Block Join Parent Query Parser

2020-06-24 Thread Tor-Magne Stien Hagen
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  
Sent: Wednesday, June 24, 2020 10:01 AM
To: solr-user 
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%2Flucene.apache.org%2Fsolr%2Fguide%2F8_5%2Fother-parsers.html%23block-join-parent-query-parserdata=02%7C01%7Ctsh%40dips.no%7C5fef4e9a68cc41c72fd208d81814e93e%7C2f46c9197c11446584b2e354fb809979%7C0%7C0%7C637285825378470570sdata=rB356EBZuDmFsTHT3ULcvr47zCcr%2F29XYaGA7%2BJ5HrI%3Dreserved=0

On Wed, Jun 24, 2020 at 10:01 AM Tor-Magne Stien Hagen  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%2Fgith
> ub.com%2Ftormsh%2FSolr-Exampledata=02%7C01%7Ctsh%40dips.no%7C5fef
> 4e9a68cc41c72fd208d81814e93e%7C2f46c9197c11446584b2e354fb809979%7C0%7C
> 0%7C637285825378470570sdata=OyjBalFeXfb0W2euL76L%2BNyRDg9ukvT8TNI
> aODCmV30%3Dreserved=0
>
> Have I misunderstood something regarding the Block Join Parent Query 
> Parser?
>
> Tor-Magne Stien Hagen
>
>

--
Sincerely yours
Mikhail Khludnev


Unexpected results using Block Join Parent Query Parser

2020-06-24 Thread Tor-Magne Stien Hagen
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://github.com/tormsh/Solr-Example

Have I misunderstood something regarding the Block Join Parent Query Parser?

Tor-Magne Stien Hagen