For specific queries: use only first 9 characters

Hi, I have a question regarding Algolia. We are building in Algolia into our Sitecore website and see that some users try to search for: ABCXXXXXX-123-456… This are random product codes that we don’t support in our website. This brings 0 results in the results page, which is normal. Is it possible to configure Algolia in the way that: IF a query like that is being used, just use the first 9 digits and remove the rest? Like: ABCXXXXXX, and search for that only? This will give the right results.

Thanks in advance!
P.