How to rank empty attributes higher than present but incorrect attributes

I’m working on a car database application. In it, I want to find trims (matching sets of attributes, like: production year, make, model, etc.) based on a query.

Records with more attributes present are ranked higher than records with less attributes, even though they have the same number of matching words.

I’m trying to figure out how/if this is something I can change. In the example below I search for Thunderbird, which returns 2 cars: Thunderbird Convertible and Thunderbird. The latter is the most relevant, but is ranked lower by Algolia. Any ideas?

Hi there,

What you can do is compute a nb_filled_attributes at indexing time and use it as custom ranking

Hi Maxime,

Thanks for your answer. That’s a pretty good idea. That would also allow for a more elaborate rating system that takes other factor in to account.

I’ll give it a shot!