lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pablo Anzorena (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-8572) Json Facets not working correctly when request is "quite complex"
Date Wed, 20 Jan 2016 19:51:39 GMT

    [ https://issues.apache.org/jira/browse/SOLR-8572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15109276#comment-15109276
] 

Pablo Anzorena commented on SOLR-8572:
--------------------------------------

Ok, I found the bug (or maybe it is not an bug). The problem was that I was using the same
tag (AUX). 
How it works nowadays, It is always keeping the last tag, if it is more than one tag on the
same level of the tree (considering the json.facet as a tree). Then it overrides the previous
ones with the same tag.

> Json Facets not working correctly when request is "quite complex"
> -----------------------------------------------------------------
>
>                 Key: SOLR-8572
>                 URL: https://issues.apache.org/jira/browse/SOLR-8572
>             Project: Solr
>          Issue Type: Bug
>          Components: Facet Module
>    Affects Versions: 5.2.1
>            Reporter: Pablo Anzorena
>
> Solr Version: 5.2.1
> Here is the json.facet parameter request:
> {code}
> {
>   mes: {
>     type: terms,
>     field: mes,
>     limit: 1,
>     offset: 0,
>     mincount: 1,
>     sort: "index desc",
>     missing: false,
>     numBuckets: true,
>     allBuckets: true,
>     facet: {
>       mostrar_cant_teus: "sum(mostrar_cant_teus)",
>       AUX: {
>         type: query,
>         q: "cod_coo:(CN)",
>         facet: {
>           cod_coo: {
>             type: terms,
>             field: cod_coo,
>             limit: 1,
>             offset: 0,
>             mincount: 1,
>             sort: "mostrar_cant_teus desc",
>             missing: false,
>             numBuckets: true,
>             allBuckets: true,
>             facet: {
>               mostrar_cant_teus: "sum(mostrar_cant_teus)",
>               AUX: {
>                 type: query,
>                 q: "cod_port_of_dep:(57035)",
>                 facet: {
>                   cod_port_of_dep: {
>                     type: terms,
>                     field: cod_port_of_dep,
>                     limit: 1,
>                     offset: 0,
>                     mincount: 1,
>                     sort: "mostrar_cant_teus desc",
>                     missing: false,
>                     numBuckets: true,
>                     allBuckets: true,
>                     facet: {
>                       mostrar_cant_teus: "sum(mostrar_cant_teus)"
>                     }
>                   }
>                 }
>               },
>               AUX: {
>                 type: query,
>                 q: "nro_shipper_unif:(1)",
>                 facet: {
>                   nro_shipper_unif: {
>                     type: terms,
>                     field: nro_shipper_unif,
>                     limit: 1,
>                     offset: 0,
>                     mincount: 1,
>                     sort: "mostrar_cant_teus desc",
>                     missing: false,
>                     numBuckets: true,
>                     allBuckets: true,
>                     facet: {
>                       mostrar_cant_teus: "sum(mostrar_cant_teus)"
>                     }
>                   }
>                 }
>               }
>             }
>           }
>         }
>       },
>       AUX: {
>         type: query,
>         q: "cod_transportista:(MSCU)",
>         facet: {
>           cod_transportista: {
>             type: terms,
>             field: cod_transportista,
>             limit: 1,
>             offset: 0,
>             mincount: 1,
>             sort: "mostrar_cant_teus desc",
>             missing: false,
>             numBuckets: true,
>             allBuckets: true,
>             facet: {
>               mostrar_cant_teus: "sum(mostrar_cant_teus)",
>               AUX: {
>                 type: query,
>                 q: "hs2:(94)",
>                 facet: {
>                   hs2: {
>                     type: terms,
>                     field: hs2,
>                     limit: 1,
>                     offset: 0,
>                     mincount: 1,
>                     sort: "mostrar_cant_teus desc",
>                     missing: false,
>                     numBuckets: true,
>                     allBuckets: true,
>                     facet: {
>                       mostrar_cant_teus: "sum(mostrar_cant_teus)"
>                     }
>                   }
>                 }
>               }
>             }
>           }
>         }
>       }
>     }
>   },
>   mostrar_cant_teus: "sum(mostrar_cant_teus)"
> }
> {code}
> And the "facets" response is the following:
> {code}
> "facets": {
> "count": 42663421,
> "mostrar_cant_teus": 60686638.53527718,
> "mes": {
> "numBuckets": 12,
> "allBuckets": {
> "count": 42663421,
> "mostrar_cant_teus": 60686638.53527718
> },
> "buckets": [
> {
> "val": "201412",
> "count": 3534902,
> "mostrar_cant_teus": 5001808.791391041,
> "AUX": {
> "count": 238136,
> "cod_transportista": {
> "numBuckets": 1,
> "allBuckets": {
> "count": 238136,
> "mostrar_cant_teus": 390971.76781999925
> },
> "buckets": [
> {
> "val": "MSCU",
> "count": 238136,
> "mostrar_cant_teus": 390971.76781999925,
> "AUX": {
> "count": 22291,
> "hs2": {
> "numBuckets": 86,
> "allBuckets": {
> "count": 25075,
> "mostrar_cant_teus": 58216.2562400001
> },
> "buckets": [
> {
> "val": "94",
> "count": 22291,
> "mostrar_cant_teus": 44126.786240000154
> }]}}}]}}}]}}
> {code}
> The problem is in the response. It is not retrieving information on the field cod_coo.
Of course it is independent of the cod_coo field, I tried with other fields and it keeps ignoring
them also.
> All the fields are of the type string, except from hs2 which is of type "text_ws".
> Let me know if you need any more info.
> Thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message