I would like, if possible, to group the product search by multiple categories.
For example:
search for products from the category “CASA” and products from the category “Celulares-e-Tablets” together in the same search using the API:
/api/catalog_system/pub/products/search
Good morning, Samir!
We’re revisiting some topics in our community that went unanswered and I ended up finding yours!
Let’s go… Checking our documentation Search for Products with Filter, Order and Pagination I found the following way to do what you need:
Karina Mota
Field Software Engineer | VTEX
Olá @samir.marques, tudo bem? Conseguiu resolver esse tema?
@KarinaMota estava fazendo alguns testes e percebi um comportamento diferente entre productId e categorias na API de busca da VTEX.
Quando adiciono múltiplos filtros de productId, funciona como esperado e retorna todos os produtos informados:
fq=productId:1937&fq=productId:1942
Porém, seguindo a mesma lógica para categorias:
fq=C:/11/22/&fq=C:/11/20/
a busca considera apenas o último parâmetro informado.
Alguém sabe se existe alguma forma de utilizar a /api/catalog_system/pub/products/search para retornar produtos pertencentes a duas ou mais categorias no mesmo request?
Obrigado!
