prefixLast and prioritize exact word matches

We have the following challenge/problem. We use search as you type and we use prefixLast. Our problem is that if the user search for e.g. ‘know’ we get results that matched ‘knowledge’ that are ranked higher than results with ‘know’. We would like that results containing ‘know’ was ranked higher than results containing ‘knowledge’. How can we achieve that ?

Best Regards Jens

1 Like

Hey @jmad,

For your exact use case, there is a special setting you could use which is exactOnSingleWordQuery: https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/#exactonsinglewordquery

This will make it so that know will be considered an exact match and as a result will be ranked better than any other word that was a prefix match.

Hi Rayrutjes

Thank you for your help. I am sorry that I forgot to reply to you

Best Jens