Search companies returns results for partial company names and company numbers:
When entering a partial company number, misleading results are sometimes returned. Example:
Searching for 06759652 – the correct result is returned
Searching for 0675965 – zero results are returned, which seems misleading
Searching for 067596 – the result for 00067596 is returned, which is incomplete and therefore seems misleading
Another example:
Searching for BR0099 – returns result for BR000099 only, but not for BR009910, which is incomplete and therefore seems misleading
Leading zeros seem to be handled nicely, but my intuitive expectation was that missing trailing values would be also, with a regex pattern like:
^.*<q-value>.*$
I am unsure whether the observed behavior is a bug or the way the API was designed. If it matches the design, then it might be helpful to add a parameter to the query that would allow results matching the company number to be excluded from the returned results entirely unless (perhaps) there were exactly 8 characters in the input.
This is intended behaviour. The company search is not done solely by company number but also by company name. Company number itself is a precise search query so you can find exact matches. Some company’s numbers have leading zeros and think of their company number as just 1234 instead of 00001234 so it will match company number with leading zeros as per your example above.
Searching by company number for any permutation wouldn’t provide useful results as the numbers are arbitrary and provide no context. The hundreds of thousands of results you would receive with a query of say ‘1’ with the proposed regex wouldn’t have any context to consider how to make use of the data. However company names that have say 1111 in might be what the searcher had meant to find. It has the context of companies with similar titles and could be filtered further after the result.