#community-help

React Instantsearch Integration Rounding Float Issue

TLDR Edward reports a rounding issue in React Instantsearch integration which impacts facets. Jason guides through a potential solution, but the issue persists. Jason suggests opening a Github issue to explore more.

Powered by Struct AI
+12
raised_hands1
thinking_face1
May 05, 2022 (16 months ago)
Edward
Photo of md5-abd5ee17039f6a27ff7f2bc0e3ef7131
Edward
01:52 PM
Hey everyone. We are seeing a strange issue with the react instantsearch integration. It appears to be rounding floats to either 2 or 3 decimal places. We can't seem to see where it's happening but it's effecting our facets. When we select a facet, it doesn't return a result because the number is now not the same as stored on the object.
Any help is greatly appreciated.
Many thanks
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:40 PM
Hmmm, could you check the network requests in the browser dev console to see if the values are returned unrounded from Typesense?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:53 PM
I remember fixing an issue like this on 0.23 RC. Not able to find the exact GitHub issue.
Edward
Photo of md5-abd5ee17039f6a27ff7f2bc0e3ef7131
Edward
02:56 PM
Jason - Just checked and yes, it's coming through the network request rounded.
It also only seems to be numbers that are in facets. Other rounded numbers are not affected
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:14 PM
Could you try this on 0.23.0.rc62?
raised_hands1
Edward
Photo of md5-abd5ee17039f6a27ff7f2bc0e3ef7131
Edward
03:21 PM
We are cloud hosted... is this still possible to do?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:21 PM
Yup. Could you email your cluster ID to [email protected] and we can take care of the upgrade for you
Edward
Photo of md5-abd5ee17039f6a27ff7f2bc0e3ef7131
Edward
03:22 PM
Perfect. I just saw the schedule system so have set it for tonight.
Thank you. Will let you know if we still experience issues tomorrow
+11
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:23 PM
Happy to expedite that now if you'd like, let me know
Edward
Photo of md5-abd5ee17039f6a27ff7f2bc0e3ef7131
Edward
03:23 PM
oooh, that would be great. Thank you
+11
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:25 PM
It's queued up now, should take another 10 - 15 minutes. I'll ping you when it's done.
03:37
Jason
03:37 PM
Edward You're all set. Could you try now?
Edward
Photo of md5-abd5ee17039f6a27ff7f2bc0e3ef7131
Edward
03:45 PM
Jason - just tested but looks the same. Not sure if it's helpful to know but they return as strings. Pretty sure that's intended though
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:46 PM
I see, could you open a Github issue for this with a minimal schema, a few documents and the search query you're using to replicate the issue?
Edward
Photo of md5-abd5ee17039f6a27ff7f2bc0e3ef7131
Edward
03:53 PM
I will do. To help you identify this issue, every number we see has 6 digits.
• 1.23456
03:54
Edward
03:54 PM
• 0.12345
• 123.456
• 1234.56
etc
03:54
Edward
03:54 PM
So not necessarily rounded...
thinking_face1