You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Sebastian Riemer <s....@littera.eu> on 2016/07/06 10:48:25 UTC

"Block join faceting is allowed with ToParentBlockJoinQuery only"

Hi,

Please consider the following three queries:


(1)    this works:

{
"responseHeader": {
    "status": 0,
    "QTime": 5,
    "params": {
      "q": "(type_s:wemi AND {!parent which='type_s:wemi'v='-type_s:wemi AND (((text:(Moby*))))'})",
      "facet.field": "m_mainAuthority_s",
      "indent": "true",
      "fq": "m_id_l:[* TO *]",
      "wt": "json",
      "facet": "true",
      "child.facet.field": [
        "corporateBodyContainer_name_t_ns_fac",
        "personContainer_name_t_ns_fac"
      ],
      "_": "1467801413472"
    }
  },

(2)    this also works:

"responseHeader": {

    "status": 0,

    "QTime": 0,

    "params": {

      "q": "(((text:(Moby*))))(type_s:wemi AND {!parent which='type_s:wemi'v='-type_s:wemi AND (((text:(Moby*))))'})",

      "indent": "true",

      "fq": "m_id_l:[* TO *]",

      "wt": "json",

      "_": "1467801481986"

    }

  },



(3)    this does not:

{

  "responseHeader": {

    "status": 400,

    "QTime": 3,

    "params": {

      "q": "(((text:(Moby*))))(type_s:wemi AND {!parent which='type_s:wemi'v='-type_s:wemi AND (((text:(Moby*))))'})",

      "facet.field": "m_mainAuthority_s",

      "indent": "true",

      "fq": "m_id_l:[* TO *]",

      "wt": "json",

      "facet": "true",

      "child.facet.field": [

        "corporateBodyContainer_name_t_ns_fac",

        "personContainer_name_t_ns_fac"

      ],

      "_": "1467801452826"

    }

  },


(1)    returns me parent documents where the child document contains the term "Moby*" including facets on a parent doc field AND facets on child doc fields (Nice!)

(2)    returns me parent documents where either the parent document or the child document contains the term "Moby*" (Hell yea!)

(3)    Fails with the error message "Block join faceting is allowed with ToParentBlockJoinQuery only" (Nay :()

So, I want both, the possibility to search for a term in all fields of the parent and the child docs AND to receive the facet counts for fields of the parent AND the child. Is what I long for possible, and if so could you please punch me in the right direction?

Many thanks,
Sebastian

Re: "Block join faceting is allowed with ToParentBlockJoinQuery only"

Posted by Marre <Ma...@gmail.com>.
I am trying to get your 2nd query to work for me but for some reason it
return not only parent documents. It also return children that match my term
text:moby*. I am not using any specific field like you are with text: is
that the problem that i have to only search for a field + value? not a value
by itself.

Sorry for not beeing able to help. 



--
View this message in context: http://lucene.472066.n3.nabble.com/Block-join-faceting-is-allowed-with-ToParentBlockJoinQuery-only-tp4285887p4286581.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: "Block join faceting is allowed with ToParentBlockJoinQuery only"

Posted by Mikhail Khludnev <gg...@gmail.com>.
Hello,

I hardly I understand why you need to find text:(Moby*) guys twice. Find
them once under {parent} is enough from my pov. Are you sure that just
using fl=[child] isn't enough, and why if so?
06 июля 2016 г. 13:48 пользователь "Sebastian Riemer" <s....@littera.eu>
написал:

> Hi,
>
> Please consider the following three queries:
>
>
> (1)    this works:
>
> {
> "responseHeader": {
>     "status": 0,
>     "QTime": 5,
>     "params": {
>       "q": "(type_s:wemi AND {!parent which='type_s:wemi'v='-type_s:wemi
> AND (((text:(Moby*))))'})",
>       "facet.field": "m_mainAuthority_s",
>       "indent": "true",
>       "fq": "m_id_l:[* TO *]",
>       "wt": "json",
>       "facet": "true",
>       "child.facet.field": [
>         "corporateBodyContainer_name_t_ns_fac",
>         "personContainer_name_t_ns_fac"
>       ],
>       "_": "1467801413472"
>     }
>   },
>
> (2)    this also works:
>
> "responseHeader": {
>
>     "status": 0,
>
>     "QTime": 0,
>
>     "params": {
>
>       "q": "(((text:(Moby*))))(type_s:wemi AND {!parent
> which='type_s:wemi'v='-type_s:wemi AND (((text:(Moby*))))'})",
>
>       "indent": "true",
>
>       "fq": "m_id_l:[* TO *]",
>
>       "wt": "json",
>
>       "_": "1467801481986"
>
>     }
>
>   },
>
>
>
> (3)    this does not:
>
> {
>
>   "responseHeader": {
>
>     "status": 400,
>
>     "QTime": 3,
>
>     "params": {
>
>       "q": "(((text:(Moby*))))(type_s:wemi AND {!parent
> which='type_s:wemi'v='-type_s:wemi AND (((text:(Moby*))))'})",
>
>       "facet.field": "m_mainAuthority_s",
>
>       "indent": "true",
>
>       "fq": "m_id_l:[* TO *]",
>
>       "wt": "json",
>
>       "facet": "true",
>
>       "child.facet.field": [
>
>         "corporateBodyContainer_name_t_ns_fac",
>
>         "personContainer_name_t_ns_fac"
>
>       ],
>
>       "_": "1467801452826"
>
>     }
>
>   },
>
>
> (1)    returns me parent documents where the child document contains the
> term "Moby*" including facets on a parent doc field AND facets on child doc
> fields (Nice!)
>
> (2)    returns me parent documents where either the parent document or the
> child document contains the term "Moby*" (Hell yea!)
>
> (3)    Fails with the error message "Block join faceting is allowed with
> ToParentBlockJoinQuery only" (Nay :()
>
> So, I want both, the possibility to search for a term in all fields of the
> parent and the child docs AND to receive the facet counts for fields of the
> parent AND the child. Is what I long for possible, and if so could you
> please punch me in the right direction?
>
> Many thanks,
> Sebastian
>