Questions about facets
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Questions about facets
I am trying to figure out how facets work over the API.
In general they work, but I would like to limit the facet options that are applicable to the subselection of products.
How can I achieve that?
Now I am using a query, which returns 6 products out of 13 products:
This query result returns me under 'included' the attributes that are visible on this image:

The problem is that there are more facets available on the next page (such as Manufacturer = HP and so on...).
How can I get full list of available facets that take into account all the filters but exclude paging?
That one I resolved with aggregation (http://localhost:8000/jsonapi/product?aggregate=index.attribute.id)
In general they work, but I would like to limit the facet options that are applicable to the subselection of products.
How can I achieve that?
Now I am using a query, which returns 6 products out of 13 products:
Code: Select all
https://aimeos.priit.yt.lan/jsonapi/product?include=attribute%2Cmedia%2Cprice%2Cproduct%2Cproduct%2Fproperty%2Ctext%2Ccatalog%2Csupplier%2Cstock%2Cproperty%2Cproduct%2Fproperty%2Ftype%2Cattribute%2Ftype&page%5Blimit%5D=6&page%5Boffset%5D=0The problem is that there are more facets available on the next page (such as Manufacturer = HP and so on...).
How can I get full list of available facets that take into account all the filters but exclude paging?
That one I resolved with aggregation (http://localhost:8000/jsonapi/product?aggregate=index.attribute.id)
Last edited by matish on 24 Nov 2025, 08:58, edited 1 time in total.
Re: Questions about facets
Another thing that came up:
Consider the following query:
Here are the explanations for each attribute ID:
I would like to select all results where (manufacturer.dell OR manufacturer.hp) AND (color.white OR color.black).
How can I make a query that would achieve that? The query that I have above does not have AND condition in the middle.
Consider the following query:
Code: Select all
https://aimeos.priit.yt.lan/jsonapi/product?include=attribute,media,price,product,product/property,text,catalog,supplier,stock,property,product/property/type,attribute/type
&page[limit]=6
&page[offset]=0
&filter[f_optid][0]=14
&filter[f_optid][1]=11
&filter[f_optid][2]=16
&filter[f_optid][3]=17
Code: Select all
14 = color.black
11 = color.white
16 = manufacturer.dell
17 = manufacturer.hp
How can I make a query that would achieve that? The query that I have above does not have AND condition in the middle.
Re: Questions about facets
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
Re: Questions about facets
I did try with that, but that one seems to result in a query:
But I need:
Code: Select all
where (manufacturer.dell OR manufacturer.hp) OR (color.white OR color.black).
Code: Select all
where (manufacturer.dell OR manufacturer.hp) AND (color.white OR color.black).
Re: Questions about facets
Please have a look at the linked documentation. The f_oneid requires a different filter structure:
Code: Select all
filter[f_oneid][color][]=...Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
Re: Questions about facets
aimeos wrote: ↑24 Nov 2025, 13:53 Please have a look at the linked documentation. The f_oneid requires a different filter structure:Code: Select all
filter[f_oneid][color][]=...
Sorry about the confusion. I took another look and got it working now. Thanks!
Code: Select all
https://aimeos.priit.yt.lan/jsonapi/product
?include=attribute,media,price,product,product/property,text,catalog,supplier,stock,property,product/property/type,attribute/type
&page[limit]=6
&page[offset]=0
&filter[f_oneid][color][0]=13
&filter[f_oneid][vendor][0]=16
&filter[f_oneid][vendor][1]=17
Re: Questions about facets
I would like to use min-price...max-price facet too. Is it possible to know what is the minimum and maximum price for the current subselection of products excluding paging?