Can someone help? Two level nested doc... ChildDocTransformerFactory sytax...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can someone help? Two level nested doc... ChildDocTransformerFactory sytax...

Petersen, Robert (Contr)
OK no faceting, no filtering, I just want the hierarchy to come backin the results. Can't quite get it... googled all over the place too.


Doc:

{ id : asdf, type_s:customer, firstName_s:Manny, lastName_s:Acevedo, address_s:"123 Fourth Street", city_s:Gotham, tn_s:1234561234,
  _childDocuments_:[
  { id : adsf_c1,
    src_s : "CRM.Customer",
type_s:customerSource,
_childDocuments_:[
                {
id : asdf_c1_c1,
type_s:customerSourceType,
                    "key_s": "id",
                    "value_s": "GUID"
                }
            ]
},
  { id : adsf_c2,
    "src_s": "DPI.SalesOrder",
type_s:customerSource,
_childDocuments_:[
                {
id : asdf_c2_c1,
type_s:customerSourceType,
                    "key_s": "btn",
                    "value_s": "4052328908"
                },
                {
id : asdf_c2_c2,
type_s:customerSourceType,
"key_s": "seq",
                    "value_s": "5"
               },
                {
id : asdf_c2_c3,
type_s:customerSourceType,
                    "key_s": "env",
                    "value_s": "MS"
                }
            ]
}
]
}


Queries:

Gives all nested docs regardless of level as a flat set
http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer]

Gives all nested child docs only
http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource]

How to get nested grandchild docs at correct level?
Nope exception:
http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],[child%20parentFilter=type_s:customerSource%20childFilter=type_s:customerSourceType]

Nope exception:
http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],[child%20parentFilter=type_s:customerSource]


Nope but no exception only gets children again tho like above:
http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],[child%20parentFilter=type_s:customer*]

Nope but no exception only gets children again:<http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],[child%20parentFilter=type_s:customer*%20childFilter=type_s:customerSourceType]>

http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],[child%20parentFilter=type_s:customer*%20childFilter=type_s:customerSourceType]


Nope same again... no grandchildren:

http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,p:[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],q:[child%20parentFilter=-type_s:customer%20parentFilter=type_s:customerSource%20childFilter=type_s:customerSourceType]


Gives all but flat no child to grandchild hierarchy:

http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,p:[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],q:[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSourceType]


Thanks in advance,

Robi

________________________________

This communication is confidential. Frontier only sends and receives email on the basis of the terms set out at http://www.frontier.com/email_disclaimer.
Reply | Threaded
Open this post in threaded view
|

Re: Can someone help? Two level nested doc... ChildDocTransformerFactory sytax...

Petersen, Robert (Contr)
OK although this was talked about as possibly coming in solr 6.x I guess it was hearsay and from what I can tell after rereading everythying I can find on the subject as of now the child docs are only retrievable as a one level hierarchy when using the ChildDocTransformerFactory



________________________________
From: Petersen, Robert (Contr) <[hidden email]>
Sent: Monday, November 6, 2017 5:05:31 PM
To: [hidden email]
Subject: Can someone help? Two level nested doc... ChildDocTransformerFactory sytax...

OK no faceting, no filtering, I just want the hierarchy to come backin the results. Can't quite get it... googled all over the place too.


Doc:

{ id : asdf, type_s:customer, firstName_s:Manny, lastName_s:Acevedo, address_s:"123 Fourth Street", city_s:Gotham, tn_s:1234561234,
  _childDocuments_:[
  { id : adsf_c1,
    src_s : "CRM.Customer",
type_s:customerSource,
_childDocuments_:[
                {
id : asdf_c1_c1,
type_s:customerSourceType,
                    "key_s": "id",
                    "value_s": "GUID"
                }
            ]
},
  { id : adsf_c2,
    "src_s": "DPI.SalesOrder",
type_s:customerSource,
_childDocuments_:[
                {
id : asdf_c2_c1,
type_s:customerSourceType,
                    "key_s": "btn",
                    "value_s": "4052328908"
                },
                {
id : asdf_c2_c2,
type_s:customerSourceType,
"key_s": "seq",
                    "value_s": "5"
               },
                {
id : asdf_c2_c3,
type_s:customerSourceType,
                    "key_s": "env",
                    "value_s": "MS"
                }
            ]
}
]
}


Queries:

Gives all nested docs regardless of level as a flat set
http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer]

Gives all nested child docs only
http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource]

How to get nested grandchild docs at correct level?
Nope exception:
http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],[child%20parentFilter=type_s:customerSource%20childFilter=type_s:customerSourceType]

Nope exception:
http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],[child%20parentFilter=type_s:customerSource]


Nope but no exception only gets children again tho like above:
http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],[child%20parentFilter=type_s:customer*]

Nope but no exception only gets children again:<http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],[child%20parentFilter=type_s:customer*%20childFilter=type_s:customerSourceType]>

http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],[child%20parentFilter=type_s:customer*%20childFilter=type_s:customerSourceType]


Nope same again... no grandchildren:

http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,p:[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],q:[child%20parentFilter=-type_s:customer%20parentFilter=type_s:customerSource%20childFilter=type_s:customerSourceType]


Gives all but flat no child to grandchild hierarchy:

http://localhost:8983/solr/temptest/select?q=id:asdf&fl=id,p:[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSource],q:[child%20parentFilter=type_s:customer%20childFilter=type_s:customerSourceType]


Thanks in advance,

Robi

________________________________

This communication is confidential. Frontier only sends and receives email on the basis of the terms set out at http://www.frontier.com/email_disclaimer.
Reply | Threaded
Open this post in threaded view
|

Re: Can someone help? Two level nested doc... ChildDocTransformerFactory sytax...

Mikhail Khludnev-2
In reply to this post by Petersen, Robert (Contr)
you can chain two [subquery] transformer, but really it's better to receive
them flat and sort child and grands across levels in post processing.

On Tue, Nov 7, 2017 at 4:05 AM, Petersen, Robert (Contr) <
[hidden email]> wrote:

> OK no faceting, no filtering, I just want the hierarchy to come backin the
> results. Can't quite get it... googled all over the place too.
>
>
> Doc:
>
> { id : asdf, type_s:customer, firstName_s:Manny, lastName_s:Acevedo,
> address_s:"123 Fourth Street", city_s:Gotham, tn_s:1234561234,
>   _childDocuments_:[
>   { id : adsf_c1,
>     src_s : "CRM.Customer",
> type_s:customerSource,
> _childDocuments_:[
>                 {
> id : asdf_c1_c1,
> type_s:customerSourceType,
>                     "key_s": "id",
>                     "value_s": "GUID"
>                 }
>             ]
> },
>   { id : adsf_c2,
>     "src_s": "DPI.SalesOrder",
> type_s:customerSource,
> _childDocuments_:[
>                 {
> id : asdf_c2_c1,
> type_s:customerSourceType,
>                     "key_s": "btn",
>                     "value_s": "4052328908"
>                 },
>                 {
> id : asdf_c2_c2,
> type_s:customerSourceType,
> "key_s": "seq",
>                     "value_s": "5"
>                },
>                 {
> id : asdf_c2_c3,
> type_s:customerSourceType,
>                     "key_s": "env",
>                     "value_s": "MS"
>                 }
>             ]
> }
> ]
> }
>
>
> Queries:
>
> Gives all nested docs regardless of level as a flat set
> http://localhost:8983/solr/temptest/select?q=id:asdf&fl=
> id,[child%20parentFilter=type_s:customer]
>
> Gives all nested child docs only
> http://localhost:8983/solr/temptest/select?q=id:asdf&fl=
> id,[child%20parentFilter=type_s:customer%20childFilter=type_
> s:customerSource]
>
> How to get nested grandchild docs at correct level?
> Nope exception:
> http://localhost:8983/solr/temptest/select?q=id:asdf&fl=
> id,[child%20parentFilter=type_s:customer%20childFilter=type_
> s:customerSource],[child%20parentFilter=type_s:
> customerSource%20childFilter=type_s:customerSourceType]
>
> Nope exception:
> http://localhost:8983/solr/temptest/select?q=id:asdf&fl=
> id,[child%20parentFilter=type_s:customer%20childFilter=type_
> s:customerSource],[child%20parentFilter=type_s:customerSource]
>
>
> Nope but no exception only gets children again tho like above:
> http://localhost:8983/solr/temptest/select?q=id:asdf&fl=
> id,[child%20parentFilter=type_s:customer%20childFilter=type_
> s:customerSource],[child%20parentFilter=type_s:customer*]
>
> Nope but no exception only gets children again:<http://localhost:8983/
> solr/temptest/select?q=id:asdf&fl=id,[child%20parentFilter=type_s:
> customer%20childFilter=type_s:customerSource],[child%
> 20parentFilter=type_s:customer*%20childFilter=type_s:customerSourceType]>
>
> http://localhost:8983/solr/temptest/select?q=id:asdf&fl=
> id,[child%20parentFilter=type_s:customer%20childFilter=type_
> s:customerSource],[child%20parentFilter=type_s:
> customer*%20childFilter=type_s:customerSourceType]
>
>
> Nope same again... no grandchildren:
>
> http://localhost:8983/solr/temptest/select?q=id:asdf&fl=
> id,p:[child%20parentFilter=type_s:customer%20childFilter=
> type_s:customerSource],q:[child%20parentFilter=-type_s:
> customer%20parentFilter=type_s:customerSource%20childFilter=type_s:
> customerSourceType]
>
>
> Gives all but flat no child to grandchild hierarchy:
>
> http://localhost:8983/solr/temptest/select?q=id:asdf&fl=
> id,p:[child%20parentFilter=type_s:customer%20childFilter=
> type_s:customerSource],q:[child%20parentFilter=type_s:
> customer%20childFilter=type_s:customerSourceType]
>
>
> Thanks in advance,
>
> Robi
>
> ________________________________
>
> This communication is confidential. Frontier only sends and receives email
> on the basis of the terms set out at http://www.frontier.com/email_
> disclaimer.
>



--
Sincerely yours
Mikhail Khludnev