Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8572

Json Facets not working correctly when request is "quite complex"

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.2.1
    • Fix Version/s: None
    • Component/s: Facet Module
    • Labels:
      None

      Description

      Solr Version: 5.2.1

      Here is the json.facet parameter request:

      {
        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)"
      }
      

      And the "facets" response is the following:

      "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
      }]}}}]}}}]}}
      

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              anzorena.fing@gmail.com Pablo Anzorena
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: