Algolia Expert Needed for Complex Filtering Implementation

Job ID: 37962034

Budget: $8 – $15 USD

I am reaching out to seek guidance on a specific challenge I'm facing with my Algolia implementation. My goal is to perform a complex filtering operation on records that contain an array of objects, specifically targeting conditions within the same object in an array.

Context and Goal:

I have records in my Algolia index representing professionals, with each record containing an array of objects under current_job_function. Each object within this array details a professional role along with the duration of experience in months (months). For example:

json
Copy code
{
"name": "João Silva",
"current_job_function": [
{ "name": "Data Analyst", "months": 24 },
{ "name": "Data Engineer", "months": 24 },
{ "name": "Product Management", "months": 120 },
{ "name": "Data Science", "months": 25 }
]
}
My aim is to filter these records to identify professionals who have specifically more than 12 months of experience in "Data Science".

Challenge Encountered:

The challenge arises because, while Algolia supports filtering based on attribute values, including numerical comparison operations like >=, it seems there isn't a straightforward way to apply these filters conditionally within the same object in an array. In essence, I'm looking for a method to ensure that both criteria (the role being "Data Science" and having more than 12 months of experience) are met by the same object within the current_job_function array.

When attempting to filter with criteria such as:

json
Copy code
["current_job_function.name:Data Science", "current_job_function.months >= 12"]
it appears that Algolia interprets each filter condition independently, rather than applying both conditions to the same object within the array. This leads to a situation where the filters do not achieve the targeted precision in filtering.

Request for Guidance:

Is there an existing feature, configuration, or a recommended practice within Algolia that I might have overlooked, which would allow for this type of precise filtering within arrays of objects? Any guidance or suggestions you could offer would be greatly appreciated, as this functionality is crucial for the search experience I'm trying to create.

Thank you for your time and assistance. I look forward to your expert advice on how to navigate this challenge.
Related categories: Research Algolia