0

Hi I' am using JSON:API Search API and Facet for my headless search page.

This is the API endpoint I am using.

/jsonapi/index/products?filter[field_tags]=15

I get this response. But in response active status is not true for the tag 15. What is the error in this? Thank you!!!

{
    "jsonapi": {
        "version": "1.0",
        "meta": {
            "links": {
                "self": {
                    "href": "http://jsonapi.org/format/1.0/"
                }
            }
        }
    },
    "data": [
        {
            "type": "product--laptops",
            "id": "119acf50-9403-42da-847a-72b8c5c582e4",
            "links": {
                "self": {
                    "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4"
                }
            },
            "attributes": {
                "langcode": "en",
                "status": true,
                "title": "MacBook Air 13” | M1 chip",
                "path": {
                    "alias": null,
                    "pid": null,
                    "langcode": "en"
                },
                "created": "2024-02-08T20:10:15+00:00",
                "changed": "2024-02-09T02:40:57+00:00",
                "default_langcode": true,
                "body": {
                    "value": "<p>MacBook Air with M1 is an incredibly portable laptop — it is nimble and quick, with a silent, fanless design and a beautiful Retina display.</p>",
                    "format": "basic_html",
                    "processed": "<p>MacBook Air with M1 is an incredibly portable laptop — it is nimble and quick, with a silent, fanless design and a beautiful Retina display.</p>",
                    "summary": ""
                },
                "field_available_colors": [
                    "blue"
                ],
                "field_available_storage": [
                    "16_gb"
                ],
                "field_istopselling": false,
                "field_product_description": "MacBook Air with M1 is an incredibly portable laptop — it is nimble and quick, with a silent, fanless design and a beautiful Retina display.",
                "field_selling_price": "492900",
                "field_starting_price": "530000"
            },
            "relationships": {
                "product_type": {
                    "data": {
                        "type": "product-type",
                        "id": "3b4cfd6c-30b6-48fd-b3f5-c408817fbe59",
                        "meta": {
                            "drupal_internal__target_id": "laptops"
                        }
                    },
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/product_type"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/relationships/product_type"
                        }
                    }
                },
                "uid": {
                    "data": {
                        "type": "user--user",
                        "id": "02ffd897-85c4-47a6-9b43-6abcfea0f5ab",
                        "meta": {
                            "drupal_internal__target_id": 1
                        }
                    },
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/uid"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/relationships/uid"
                        }
                    }
                },
                "stores": {
                    "data": [
                        {
                            "type": "store--accessories",
                            "id": "3efdcd6a-2fb7-46fe-a43c-465649237370",
                            "meta": {
                                "drupal_internal__target_id": 2
                            }
                        },
                        {
                            "type": "store--mobile-phones",
                            "id": "8cf16e6b-ccef-4073-a940-9f5df3fba28e",
                            "meta": {
                                "drupal_internal__target_id": 1
                            }
                        }
                    ],
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/stores"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/relationships/stores"
                        }
                    }
                },
                "variations": {
                    "data": [
                        {
                            "type": "product-variation--laptops",
                            "id": "fe0fb7ee-9ba9-475f-b517-edec300fbe8b",
                            "meta": {
                                "drupal_internal__target_id": 25
                            }
                        },
                        {
                            "type": "product-variation--laptops",
                            "id": "9e80862d-120b-4df9-8f35-5994400f1e2a",
                            "meta": {
                                "drupal_internal__target_id": 26
                            }
                        }
                    ],
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/variations"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/relationships/variations"
                        }
                    }
                },
                "default_variation": {
                    "data": {
                        "type": "product-variation--laptops",
                        "id": "fe0fb7ee-9ba9-475f-b517-edec300fbe8b",
                        "meta": {
                            "drupal_internal__target_id": 25
                        }
                    },
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/default_variation"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/relationships/default_variation"
                        }
                    }
                },
                "field_brand": {
                    "data": {
                        "type": "taxonomy_term--brands",
                        "id": "9645ce9b-728d-4ffe-a1b1-d44a12977820",
                        "meta": {
                            "drupal_internal__target_id": 16
                        }
                    },
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/field_brand"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/relationships/field_brand"
                        }
                    }
                },
                "field_product_image": {
                    "data": [
                        {
                            "type": "file--file",
                            "id": "2a9eda00-abe8-4d22-a615-7ac9b5f589b6",
                            "meta": {
                                "alt": "MacBook Air 13” | M1 chip - H",
                                "title": "",
                                "width": 420,
                                "height": 320,
                                "drupal_internal__target_id": 100
                            }
                        }
                    ],
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/field_product_image"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/relationships/field_product_image"
                        }
                    }
                },
                "field_tags": {
                    "data": {
                        "type": "taxonomy_term--popular_tags",
                        "id": "fb654dcc-fa58-419d-a369-cf3c84338fec",
                        "meta": {
                            "drupal_internal__target_id": 15
                        }
                    },
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/field_tags"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/119acf50-9403-42da-847a-72b8c5c582e4/relationships/field_tags"
                        }
                    }
                }
            }
        },
        {
            "type": "product--laptops",
            "id": "a888bf04-fda9-4444-9373-f704b119feb3",
            "links": {
                "self": {
                    "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3"
                }
            },
            "attributes": {
                "langcode": "en",
                "status": true,
                "title": "Acer Aspire 3 A315 Notebook",
                "path": {
                    "alias": null,
                    "pid": null,
                    "langcode": "en"
                },
                "created": "2024-02-09T02:29:26+00:00",
                "changed": "2024-02-09T02:37:50+00:00",
                "default_langcode": true,
                "body": {
                    "value": "<p>Powered by an Intel Pentium processor and ample RAM, this notebook ensures smooth multitasking and responsive performance.</p>",
                    "format": "basic_html",
                    "processed": "<p>Powered by an Intel Pentium processor and ample RAM, this notebook ensures smooth multitasking and responsive performance.</p>",
                    "summary": ""
                },
                "field_available_colors": [
                    "blue"
                ],
                "field_available_storage": [
                    "8_gb",
                    "16_gb"
                ],
                "field_istopselling": false,
                "field_product_description": "Powered by an Intel Pentium processor and ample RAM, this notebook ensures smooth multitasking and responsive performance.",
                "field_selling_price": " 179000.00",
                "field_starting_price": "189000.00"
            },
            "relationships": {
                "product_type": {
                    "data": {
                        "type": "product-type",
                        "id": "3b4cfd6c-30b6-48fd-b3f5-c408817fbe59",
                        "meta": {
                            "drupal_internal__target_id": "laptops"
                        }
                    },
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/product_type"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/relationships/product_type"
                        }
                    }
                },
                "uid": {
                    "data": {
                        "type": "user--user",
                        "id": "02ffd897-85c4-47a6-9b43-6abcfea0f5ab",
                        "meta": {
                            "drupal_internal__target_id": 1
                        }
                    },
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/uid"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/relationships/uid"
                        }
                    }
                },
                "stores": {
                    "data": [
                        {
                            "type": "store--mobile-phones",
                            "id": "8cf16e6b-ccef-4073-a940-9f5df3fba28e",
                            "meta": {
                                "drupal_internal__target_id": 1
                            }
                        }
                    ],
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/stores"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/relationships/stores"
                        }
                    }
                },
                "variations": {
                    "data": [
                        {
                            "type": "product-variation--laptops",
                            "id": "4ab38637-93b8-4a00-82f0-ddc44e01f05c",
                            "meta": {
                                "drupal_internal__target_id": 27
                            }
                        }
                    ],
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/variations"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/relationships/variations"
                        }
                    }
                },
                "default_variation": {
                    "data": {
                        "type": "product-variation--laptops",
                        "id": "4ab38637-93b8-4a00-82f0-ddc44e01f05c",
                        "meta": {
                            "drupal_internal__target_id": 27
                        }
                    },
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/default_variation"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/relationships/default_variation"
                        }
                    }
                },
                "field_brand": {
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/field_brand"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/relationships/field_brand"
                        }
                    }
                },
                "field_product_image": {
                    "data": [
                        {
                            "type": "file--file",
                            "id": "b5c9576c-d2f8-4a0f-8300-4b89814450fd",
                            "meta": {
                                "alt": "Acer Laptop - H",
                                "title": "",
                                "width": 420,
                                "height": 320,
                                "drupal_internal__target_id": 130
                            }
                        }
                    ],
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/field_product_image"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/relationships/field_product_image"
                        }
                    }
                },
                "field_tags": {
                    "data": {
                        "type": "taxonomy_term--popular_tags",
                        "id": "fb654dcc-fa58-419d-a369-cf3c84338fec",
                        "meta": {
                            "drupal_internal__target_id": 15
                        }
                    },
                    "links": {
                        "related": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/field_tags"
                        },
                        "self": {
                            "href": "http://13.234.216.10/jsonapi/products/laptops/a888bf04-fda9-4444-9373-f704b119feb3/relationships/field_tags"
                        }
                    }
                }
            }
        }
    ],
    "meta": {
        "count": 2,
        "facets": [
            {
                "id": "brand",
                "label": "Brand",
                "path": "brand",
                "terms": [
                    {
                        "url": "http://13.234.216.10/jsonapi/index/products?filter%5Bfield_tags%5D=15&filter%5Bbrand%5D=16",
                        "values": {
                            "value": "16",
                            "label": "Apple",
                            "active": false,
                            "count": 1
                        }
                    }
                ]
            },
            {
                "id": "product_type",
                "label": "Product type",
                "path": "product_type",
                "terms": [
                    {
                        "url": "http://13.234.216.10/jsonapi/index/products?filter%5Bfield_tags%5D=15&filter%5Bproduct_type%5D=laptops",
                        "values": {
                            "value": "laptops",
                            "label": "Laptops",
                            "active": false,
                            "count": 2
                        }
                    }
                ]
            },
            {
                "id": "starting_price",
                "label": "Starting Price",
                "path": "starting_price",
                "terms": [
                    {
                        "url": "http://13.234.216.10/jsonapi/index/products?filter%5Bfield_tags%5D=15&filter%5Bstarting_price%5D=189000",
                        "values": {
                            "value": "189000",
                            "label": "189000",
                            "active": false,
                            "count": 1
                        }
                    },
                    {
                        "url": "http://13.234.216.10/jsonapi/index/products?filter%5Bfield_tags%5D=15&filter%5Bstarting_price%5D=530000",
                        "values": {
                            "value": "530000",
                            "label": "530000",
                            "active": false,
                            "count": 1
                        }
                    }
                ]
            },
            {
                "id": "tags",
                "label": "Tags",
                "path": "tags",
                "terms": [
                    {
                        "url": "http://13.234.216.10/jsonapi/index/products?filter%5Bfield_tags%5D=15&filter%5Btags%5D=13",
                        "values": {
                            "value": "13",
                            "label": "Apple",
                            "active": false,
                            "count": 2
                        }
                    },
                    {
                        "url": "http://13.234.216.10/jsonapi/index/products?filter%5Bfield_tags%5D=15&filter%5Btags%5D=41",
                        "values": {
                            "value": "41",
                            "label": "Galaxy",
                            "active": false,
                            "count": 1
                        }
                    },
                    {
                        "url": "http://13.234.216.10/jsonapi/index/products?filter%5Bfield_tags%5D=15&filter%5Btags%5D=15",
                        "values": {
                            "value": "15",
                            "label": "Laptops",
                            "active": false,
                            "count": 2
                        }
                    }
                ]
            }
        ]
    },
    "links": {
        "self": {
            "href": "http://13.234.216.10/jsonapi/index/products?filter%5Bfield_tags%5D=15"
        }
    }
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.