2

Algolia says:
"So our price widget doesn't allow decimals, you'll have to create a custom widget"

I do it.

"Hey, It's not working and I verified it's applying the filter correctly. I noticed my price is a string in your index, maybe that's incorrect and causing it to not work?"

They say: "Yep, you'll need to run an update to fix that and change all to floats" (charges an arm and a leg for the thousands of index operations needed to update the data type)

I clear the index and send a single one as a test, verifying it's a float by casting it using (float) then var_dumping. It shows "double(3.99)", but when it gets to Algolia, it's 0.

So I contact support.

"Hi, I'm sending across floats like you say but it's receiving it as 0, am I doing something wrong? Here's my code and the result of the var_dump"

They respond: "Looks like you're doing it right, but our log shows us receiving 3.999399593939, maybe check your PHP.ini for "serialize_precision" and make sure it's set to -1"

I check and it's fine, then I realize that var_dump is probably rounding to 2 decimal points so I change my cast to (float) number_format($row['Price'], 2) and wallah...it works.

Now I've wasted days of paying for their service, a ton of charges for indexing operations, and it was such a simple fix.

if they had thrown an error for the infinite decimal, that would have helped, but instead I had to reach out to find out that was the issue.

#Frustrated.

Comments
Add Comment