Services Plugins FAQs

Issue using multiple filters in Algolia plugin

Hi, I’m having some issues combining multiple filters with the Algolia Plugin (V 3.29.0).

I reviewed the other thread (Need help with Algolia Filter Setup) on this but the addition of parentheses doesn’t seem to be required since I’m only using the AND operator. Do I have something incorrect with my syntax?

What I’m trying to set up:


which equates to the following when filters are chosen:
MOFO-MAVEN

Hello, @andrewmccalister
Thanks for your message.

We also received your message on the Bubble Forum.
As it was noted, we will check with our Development team exactly what is wrong with these settings and if it is possible to add multiple settings.

Due to the fact that we have some additional questions regarding your settings, can you please add our Support Team email to the list of collaborators to your application and provide me a link to your application? This will allow us to check your settings and run some tests to fix the mentioned problem.

To add our Support Team as a collaborator, you need to do the following steps in the Bubble Editor:

Settings > Collaboration > Add email support@zeroqode.com

Note: avoid the warning message regarding the plan, as we are an agency and you can easily add us to your collaborators.

I will revert to you with an answer as soon as possible.
Best regards,

Hey @Ecaterina ,

Added the email as a Collaborator.

Link to editor: MOFO-MAVEN | Bubble Editor

1 Like

Hello,
Thanks for adding our team to your app.

I will revert to you with an update once we will check your application and define the issue.
It can take some time.

Thanks for your understanding.
Best regards,

Hi @Ecaterina, thanks for your response.

When you say it may take a little time, are we talking days, weeks, longer…?

A

@andrewmccalister

Please note that It can take a few days, no longer :slightly_smiling_face:
Thank you!

Best regards,

1 Like

Hello, @andrewmccalister

We checked your application and suppose that the issue in the filtered results was related to the Logical Operator you are using, I mean “AND”:

Please note that in case you are using “AND”, the item should correspond to every filter:

However, once we tried to use “OR”, we received the correct result within your app.

Also, do not forget to use the space ofter the set of the delimiter in the plugin’s element.

Hope it would be helpful.
Best regards,

Hi @Ecaterina, thanks for your response.

On a side note, I need the filters to be AND. For example, If someone has selected the category: ‘Seating’ and Manufacturer: ‘Memo Furniture’ I only want to see ‘Seating’ by ‘Memo Furniture’, not products that have the category ‘Seating’ OR the manufacturer ‘Memo Furniture’.

I’m still having some fundamental issues, but I think I’ve understood the core problem:

When I pass an empty parameter into the filter, it seems like the search is looking for a product where the filter is empty. For example, if I want to filter products to only see products from Memo Furniture with a Price <5,000, it works great:



But when I keep the filter parameters the same (i.e still passing ‘List Price - Min’ and ‘Manufacturer’) but change the options so I want to see products from ANY manufacturer (i.e removing the ‘Memo Furniture’ filter) with a ‘price < 5000’ it breaks since the Manufacturer Parameter is “”:


As you can see, I should be seeing more products, since I’ve removed the constraint of ‘Memo Furniture’ having to be a Manufacturer but I’m seeing no responses.

It seems like the way to solve this is for Algolia to ignore empty ("") parameters, is this possible? I’v enot seen a way to do it.

Another, FAR more hacky way is by using conditional statements to change the Filter parameter based on what filters are chosen by the user so that we are never passing the empty parameters like Manufacturer: “” to Algolia.

Is this the correct solution? My concern would be this gets unwieldy very quickly - with 4 different filters, we’d need 16 different conditional statements, 5 filters = 32 conditionals, 6 filters = 64 conditionals, and so on…

ok, for anyone interested I got to the solution.

Firstly, there were actually three things causing issues:

  1. You can’t send a filter with an empty parameter (i.e Manufacturer: “”)
  2. For Attributes with a space (’ ') in the name, you need to put the attribute name in “”. e.g an Attribute named List Price needs to be added to the Filter as “List Price”.
  3. You can’t have Boolean operators (AND) not attached to an Attribute. “Manufacturer”: “Mfr_1” AND “List Price” < 5000 will work but “Manufacturer”: “Mfr_1” AND will not work.

This all means that having dynamic filtering takes more thought.

I set it up such that an Attribute is only included in the Filter if a user has chosen to filter the RG by that Attribute (meaning it exists in a custom state and has a value) - via :format as text for a list or :find & replace for a single item. I combined that with conditionals so there was never an ‘AND’ without an associated Attribute.

1 Like

Hello, @andrewmccalister
Sorry for my long reply to you.

I’m happy that you were able to find a workaround for your specific case.
If we can help you with anything else - let me know.

Best regards,

Hello, @andrewmccalister

By this message, we would like to notify you that we have updated the plugin and added new action ’ Save Objects’.
Please update the plugin to Version: 3.31.0. and try it.

I hope you’ll find it useful for you.
Best regards,

Hi @Ecaterina,

I don’t actually see the ‘Save Object’ action but I do see an ‘Add Objects (backend)’.

Are they the same thing?

Hello, @andrewmccalister

Please allow me to check that and revert with an update ASAP.

Best regards,

1 Like

Hello, @andrewmccalister

Please note that “Add Objects” is an action that was created for saving objects.

You can use it both for Backend or Frontend for achieving your goals.

Hope it would help you.
Best regards,

Testing out ‘Add Object’ and I seem to be running into an issue in parsing between Bubble and Algolia.

If I try and pass an empty numerical value from Bubble to Algolia, it won’t accept it. Algolia wants it specified as null. Is there a way for the plugin to automatically fill blank numerical values as null?

Otherwise, we’ll have to do extensive Conditional formatting since I have a range of numerical objects that can be empty.

Hello, @andrewmccalister
Thanks for pointing this out.

Please allow us to check this with our development team and revert with our verdict as soon as possible.

Best regards,

@andrewmccalister

I discussed this with our developers and would like to note the next:
The field, which came blank, could break the JSON, which is used by Algolia (it can’t be parsed).

In the case of an empty string field, Algolia can understand that this string is empty. However, in case of a number field and it’s set to null, JSON will have a field without value, so it’s become invalid.

Bet regards,

Hi Ecaterina,

Apologies if I wasn’t clear, but my earlier post was actually a feature request.

I understand a numerical JSON value needs to be set as ‘null’ if empty, but when you have data in Bubble that frequently has blank or non blank numerical values, it means you need to do extensive conditional formatting to pass either a numerical value or a ‘null’.

My request: Zeroqode automatically recognizes if the numerical value is blank or has a value and formats the JSON data to ‘null’ if blank, or includes numerical value if not blank.

Hello, @andrewmccalister
Thanks for more details.

I will forward this idea to our development team. We need to see how feasible it will be for us right now.
I can’t provide you with any estimates on this matter.

I will revert to you with an update once will receive it.
Best regards,

Hey, @andrewmccalister
Thanks for your patience.

I’ve just discussed your request with our team, and they suggested you the next workaround:
Since you are using the action “add Objects”, we can’t manipulate the received data, since it is received by API.
This problem could be simply resolved with the Bubble Condition:

Hope it would be helpful for you.
Best regards,