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 jeebix <jb...@initiatives.fr> on 2018/07/12 15:44:10 UTC

SOLR json request API syntax on facet domain with filter & field list

Hello everybody,

I work on a SOLR version 6.0.0. I use the JSON request API to facet the
results. Here is a SOLR query example :

{"query":"object_type_s:contact","params":{"wt":"json","start":0,"rows":10},"filter":[],"facet":"byNestedGammes":{"type":"terms","field":"gamme","domain":{"blockChildren":"object_type_s:contact"},"sort":"index","limit":-1},"byEtatMarketing":{"type":"terms","field":"etat_marketing_s","sort":"count","limit":-1},"bySuite":{"type":"terms","field":"kits_sans_suite_ss","sort":"count","limit":-1},"byAgeInactivite":{"type":"terms","field":"age_inactivite_s","domain":{"excludeTags":"byAgeInactivite"},"sort":"count","limit":-1},"byTTC":{"type":"terms","field":"TTC_i","domain":{"blockChildren":"object_type_s:contact","filter":"enseigne_s:INI"},"sort":"index","limit":-1}},"sort":""}

For the "byTTC" facet, the "domain" parameter with "blockChildren" returns
all values of TTC_i, a field nested in a parent document. Example :

"id":"693897.870735",
        "asso_i":693897,
        "personne_i":870735,
        "etat_technique_s":"avec_documents",
        "etat_marketing_s":"actif",
        "type_parent_s":"Société",
        "groupe_type_parent_s":"SOCIETE",
        "_childDocuments_":[
        {
          "kit_sans_suite":["false"],
          "TTC_i":300,
          "type_cde_s":"DEVIS",
          "object_type":["order"],
          "enseigne_s":"INI"}

I don't underdtand why the results are the same for the facet byTTC with or
without filter parameter in the domain
("domain":{"blockChildren":"object_type_s:contact","filter":"enseigne_s:INI").

It should filter the results when in a child document "enseigne_s" has the
value "INI", but not...

I thought I had to add the field list parameter to return child documents
with parent documents (like on the solr UI admin : "fl":"*,[child
parentFilter=object_type_s:contact]"), but I can't find the syntax for that
parameter in the JSON request API...

Thanks for your help.

Best

JB



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: SOLR json request API syntax on facet domain with filter & field list

Posted by Mikhail Khludnev <mk...@apache.org>.
JB,
It should work. Can you confirm that you have non INI children in docset?
What is you negate that filter? debug=all is really verbose but it allows
to see how "filter" is parsed.

On Thu, Jul 12, 2018 at 5:44 PM jeebix <jb...@initiatives.fr> wrote:

> Hello everybody,
>
> I work on a SOLR version 6.0.0. I use the JSON request API to facet the
> results. Here is a SOLR query example :
>
>
> {"query":"object_type_s:contact","params":{"wt":"json","start":0,"rows":10},"filter":[],"facet":"byNestedGammes":{"type":"terms","field":"gamme","domain":{"blockChildren":"object_type_s:contact"},"sort":"index","limit":-1},"byEtatMarketing":{"type":"terms","field":"etat_marketing_s","sort":"count","limit":-1},"bySuite":{"type":"terms","field":"kits_sans_suite_ss","sort":"count","limit":-1},"byAgeInactivite":{"type":"terms","field":"age_inactivite_s","domain":{"excludeTags":"byAgeInactivite"},"sort":"count","limit":-1},"byTTC":{"type":"terms","field":"TTC_i","domain":{"blockChildren":"object_type_s:contact","filter":"enseigne_s:INI"},"sort":"index","limit":-1}},"sort":""}
>
> For the "byTTC" facet, the "domain" parameter with "blockChildren" returns
> all values of TTC_i, a field nested in a parent document. Example :
>
> "id":"693897.870735",
>         "asso_i":693897,
>         "personne_i":870735,
>         "etat_technique_s":"avec_documents",
>         "etat_marketing_s":"actif",
>         "type_parent_s":"Société",
>         "groupe_type_parent_s":"SOCIETE",
>         "_childDocuments_":[
>         {
>           "kit_sans_suite":["false"],
>           "TTC_i":300,
>           "type_cde_s":"DEVIS",
>           "object_type":["order"],
>           "enseigne_s":"INI"}
>
> I don't underdtand why the results are the same for the facet byTTC with or
> without filter parameter in the domain
>
> ("domain":{"blockChildren":"object_type_s:contact","filter":"enseigne_s:INI").
>
> It should filter the results when in a child document "enseigne_s" has the
> value "INI", but not...
>
> I thought I had to add the field list parameter to return child documents
> with parent documents (like on the solr UI admin : "fl":"*,[child
> parentFilter=object_type_s:contact]"), but I can't find the syntax for that
> parameter in the JSON request API...
>
> Thanks for your help.
>
> Best
>
> JB
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>


-- 
Sincerely yours
Mikhail Khludnev