针对其值之一 (json) 筛选一个属性(数组)

Filter for one attribute (array) for one of its value (json)

有以下记录

   {
      "name": "
 Festões Plástico, 12mt x 17cm - Festas Populares",
      "categories": [
        "Festas",
        "Casamentos",
        "Decorações"
      ],
      "hierarchicalCategories": {
        "lvl0": "Festas",
        "lvl1": "Festas > Casamentos",
        "lvl2": "Festas > Casamentos > Decorações"
      },
      "description": "",
      "brand": "Misterius",
      "price": 14.94,
      "stock": "Disponível",
      "prices": [
        {
          "value": 12,
          "type": "specificValue",
          "family": "fatos",
          "subfamily": "example"
        },
        {
          "value": 13,
          "type": "specificValue13",
          "family": "fatos13",
          "subfamily": "example13"
        },
        {
          "value": 14,
          "type": "specificValue14",
          "family": "fatos14",
          "subfamily": "example14"
        },
        {
          "value": 15,
          "type": "specificValue15",
          "family": "fatos15",
          "subfamily": "example15"
        },
        {
          "value": 16,
          "type": "specificValue16",
          "family": "fatos16",
          "subfamily": "example16"
        }
      ],
      "color": [
        {
          "name": "Amarelo",
          "label": "Amarelo,#FFFF00",
          "hexa": "#FFFF00"
        },
        {
          "name": "Azul",
          "label": "Azul,#0000FF",
          "hexa": "#0000FF"
        },
        {
          "name": "Branco",
          "label": "Branco,#FFFFFF",
          "hexa": "#FFFFFF"
        },
        {
          "name": "Laranja",
          "label": "Laranja,#FFA500",
          "hexa": "#FFA500"
        },
        {
          "name": "Verde Escuro",
          "label": "Verde Escuro,#006400",
          "hexa": "#006400"
        },
        {
          "name": "Vermelho",
          "label": "Vermelho,#FF0000",
          "hexa": "#FF0000"
        }
      ],
      "specialcategorie": "",
      "reference": "3546",
      "rating": 0,
      "free_shipping": false,
      "popularity": 0,
      "objectID": "30"
    }

现在通过搜索 "Festas Populares" 将 return 记录及其属性,是否也可以将一个属性数组作为 "prices" 过滤为仅 return 一个json。例如 "prices.type"="specificValue14" 和 "family"="fatos14" 和 "family"="fatos" 和 "subfamily"="example"

{
“value”: 14,
“type”: “specificValue14”,
“family”: “fatos14”,
“subfamily”: “example14”
}

记录 return 将是:

 {
          "name": "
 Festões Plástico, 12mt x 17cm - Festas Populares",
          "categories": [
            "Festas",
            "Casamentos",
            "Decorações"
          ],
          "hierarchicalCategories": {
            "lvl0": "Festas",
            "lvl1": "Festas > Casamentos",
            "lvl2": "Festas > Casamentos > Decorações"
          },
          "description": "",
          "brand": "Misterius",
          "price": 14.94,
          "stock": "Disponível",
          "prices": [
            {
              "value": 14,
              "type": "specificValue14",
              "family": "fatos14",
              "subfamily": "example14"
            }
          ],
          "color": [
            {
              "name": "Amarelo",
              "label": "Amarelo,#FFFF00",
              "hexa": "#FFFF00"
            },
            {
              "name": "Azul",
              "label": "Azul,#0000FF",
              "hexa": "#0000FF"
            },
            {
              "name": "Branco",
              "label": "Branco,#FFFFFF",
              "hexa": "#FFFFFF"
            },
            {
              "name": "Laranja",
              "label": "Laranja,#FFA500",
              "hexa": "#FFA500"
            },
            {
              "name": "Verde Escuro",
              "label": "Verde Escuro,#006400",
              "hexa": "#006400"
            },
            {
              "name": "Vermelho",
              "label": "Vermelho,#FF0000",
              "hexa": "#FF0000"
            }
          ],
          "specialcategorie": "",
          "reference": "3546",
          "rating": 0,
          "free_shipping": false,
          "popularity": 0,
          "objectID": "30"
        }

在某些情况下,一个产品可以有多个关联的价格,对于特定用户,或者某一天有活动提供折扣等,因此对于这种情况,想要过滤与 product/record 关联的价格。

不,Algolia 无法做到这一点。返回的记录始终带有 attributesToRetrieve 内指定的属性。这些属性完整返回。