Skip to content

Search Queries with specificationFilter returns a empty products object #241

@gustavo-vasconcellos

Description

@gustavo-vasconcellos

Expected Behavior

The search query should be able to search any specifications values even if it contains a special character.

Current Behavior

The following variable object with the search query should return all filtered products, but returns an empty array. I suspect it's because of a / in the value of the rest parameter, which is the value of specificationFilter_216.

{
    "query": "Ambientes/Quarto",
    "map": "c,c,specificationFilter_216",
    "rest": "C/Cabideiro",
    "orderBy": "OrderByPriceDESC",
    "from": 0,
    "to": 23
}

Possible Solution

Maybe if change the search path and refactor the logic use the Search API path with fq=specificationFilter_{id}:{value}

Steps to Reproduce (for bugs)

  1. Create a sku field if a value that contains at least a /
  2. Use the store-theme app and go to the category page
  3. Filter the page

Context

I'm using the query with a custom application and filters have this value.

Your Environment

manifest.json:

"builders": {
    "styles": "1.x",
    "store": "0.x"
  },
  "dependencies": {
    "vtex.store": "2.x",
    "vtex.store-header": "2.x",
    "vtex.store-footer": "2.x",
    "vtex.carousel": "2.x",
    "vtex.shelf": "1.x",
    "vtex.product-details": "1.x",
    "vtex.product-kit": "1.x",
    "vtex.search-result": "3.x",
    "vtex.store-components": "3.x",
    "vtex.login": "2.x",
    "vtex.menu": "2.x",
    "vtex.minicart": "2.x",
    "vtex.my-account": "1.x"
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions