Dynamic faceted fields on Algolia

I have a special case where I need the indice “Leads” to accept a variety of custom properties provided by end users such as:

  name: 'John Doe',
  custom_var1: '$265',
  custom_var2: 'google_adwords'

I want to be able to filter fields like “custom_var1” . Keep in mind different users have leads with different custom variables.

Does algolia support this?

Hi @redkin,

Thanks for contacting Algolia. You can take a look at our filters, which allow you to refine your results to a subset of data depending on the attribute and value you choose.

For a discussion on filters, please see here.

Algolia holds data in the structure that you provide. Therefore, your index Leads can hold any number of attributes that you choose, such as custom_var1 or custom_var2, as long as you decide to push it up to Algolia and update the record and filter using whatever library/integration works best for your platform.

For a full list of our libraries and integrations, please see here.

Happy coding with Algolia!

Is there a limit on how many different attributes can exist across multiple records (leads)?

The problem is that when you have thousands of users, and each user uses 100’s of different custom variable fields that other users don’t use. that’s when the problem rises.

User x could have: { foo: 122, bar: 353 }, another user could have { tomato: 'reer', potato: 'vbcb'}

Would I really have to keep adding new fields to attributesForFaceting? and is that even practical given the vast amount of different attributes that users will use?

Hi @redkin,

You asked:

No, but there is a limit on the record size, depending on your plan. Records size caps start at 10KB, then go upto 20KB, then custom for our largest plans. Please see our pricing page here.

You asked:

I more clearly see how different your records will be based on your examples. Each new attribute that does not yet exist would have to be set as a new searchable attribute or attribute for faceting (is that is how you will use it). We generally recommend 10 or fewer searchable attributes to make the most of Algolia.