I am trying to implement logic for querying people collections for suggestion of names based on a combination of arguments of 3 possible (name, surname, nick), eg:
people.where('name', '==', nameArg).where('surname', '>=', surnameArg).where('surname', '<=', surnameArg + '\uf8ff')
or
people.where('nick', '==', nickArg).where('name', '>=', nameArg).where('name', '<=', nameArg+ '\uf8ff')
The idea is that there might be any 1 or 2 fields using == operator and one with >= / <=. I got the error 9 FAILED_PRECONDITION: The query requires an index., so I created an index using all 3 of the fields. But when my query uses only 2 of the fields I still get the same error.
Am I expected to create 4 indices for every combination of query parameters? This feels so wrong.
Does the order of fields in the index matter too?