Postcode formatting


I was wondering what the best way to format postcodes are for consistent results. We were initially searching by UK postcodes without a space (‘XXXXX’ rather than ‘XX XXX’).
This was fine for the most part but then we had an issue when it couldn’t return a result, unless we searched for that postcode with the space, so we started formatting the postcodes with spaces (‘XX XXX’). We have noticed though that this also sometimes causes problems, and the geocoder only works for certain postcode without a space.

I also wondered if it was possible to specify that we are searching only by postcode? We have had instances where the geocoder returns multiple results across the country, sometimes none of them are the address we are looking for, sometimes it is an erroneous postcode. If we could limit the search to postcodes I feel like it would eliminate some of the issues we are having?

Thank you again, and kind regards,