I’m wondering if there are some best practices around searching through data that can be represented in various ways, in my case phone numbers. Specifically, the international indicator might be included in various ways (eg “0033” or “+33”), might be omitted, and spaces can be included or not.
I’m hesitating between storing the number in one format and doing some string manipulation on the query - at the risk of manipulating some word that was intended for another attribute - or storing all necessary representations of the number.
I see that spaces matching work only if there are no typos, which means the user has to type in all the number before seeing results if i don’t store spaces. Which leads me to think i need to store the numbers both with and without spaces. But if i do so, i have the feeling i would loose the highlightResults feature, as it might jump between one representation and another, which can be awkward.
Many thanks for your help!