#community-help

Toggle Refinement Error in InstantSearch

TLDR em1nos encountered an error with the InstantSearch Toggle Refinements widget. Kishore Nallan and Jason assisted and resolved the issue with an updated adapter version.

Powered by Struct AI
+12
raised_hands2
15
26mo
Solved
Join the chat
Jul 15, 2021 (26 months ago)
em1nos
Photo of md5-f33ae8b829901656b655c985c894be3a
em1nos
10:08 AM
I'm trying to use the InstantSearch Toogle Refinement (https://www.algolia.com/doc/api-reference/widgets/toggle-refinement/vue/)
Getting this error: Error: 400 - Values of filter field published: must be true or false.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:09 AM
Jason when you're around.
raised_hands1
em1nos
Photo of md5-f33ae8b829901656b655c985c894be3a
em1nos
10:09 AM
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:10 AM
The backend query shouldn't contain the backticks.
em1nos
Photo of md5-f33ae8b829901656b655c985c894be3a
em1nos
10:11 AM
that's what I thought. I think this might be a bug with the adapter then wrapping the boolean in backticks.
10:12
em1nos
10:12 AM
the widget should be sending through a boolean as default, but I also tried setting it manually like this:
10:12
em1nos
10:12 AM
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:13 AM
Yes the adaptor should account for the field type here.
10:14
Kishore Nallan
10:14 AM
Backticks were added in tbe recent version so probably a regression.
+11
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:31 PM
Oof, will fix that shortly.
+11
07:00
Jason
07:00 PM
em1nos Could you try with v2.0.1-0 of the adapter?
em1nos
Photo of md5-f33ae8b829901656b655c985c894be3a
em1nos
07:00 PM
sure thing!
07:02
em1nos
07:02 PM
works! thanks!
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:02 PM
Yaay
07:02
Jason
07:02 PM
Turns out I didn't have a test for the toggle refinement all this while, though I thought I did, which is why this slipped through
raised_hands1