Facets - Filtering with multiple options


#1

I am developing Facets-filtering features by using reference of this article: https://swiftype.com/documentation/site-search/tutorials/faceted_search .

All is working fine but I want to know how we can pass the multi selected facets values to API link, below is the example link where Facets is ‘Asset-type’.

https://api.swiftype.com/api/v1/public/engines/search.json?callback=jQuery1112013905824980079806_1540811695399&q=resource&engine_key=XXXXXXXXXXXXXX&page=1&per_page=10&facets[page][]=asset-type&filters[page][asset-type][values][]=Datasheet&spelling=strict&_=1540811695401

Please let me know how I can pass the multiple ‘Asset-type’ values in the API link ?

thanks,
Karamveer Singh


#2

Anybody have solution & Idea on my problem?


#3

Hey @karamveer.singh.

There is a brief description of “parameter encoding” in the API Docs here: https://swiftype.com/documentation/site-search/overview#parameter_encoding, which I believe shows an example of this.

I think you would just pass multiple instance of that parameter, so, if you were going to pass both value1 and value2:

&filters[page][asset-type]=value1&filters[page][asset-type]=value2

Jason