1. A method performed by one or more computers, the method comprising: maintaining a collection of uniform resource locator (URL) patterns, wherein each URL pattern is associated with a respective label; receiving a search query that includes a query term and a label of interest from a client device; generating, for the label of interest, by operation of a computer system, a domain filter that satisfies a maximum size threshold and a maximum false positive error rate threshold, wherein generating the domain filter includes: iteratively adjusting a size of the domain filter, wherein in each iteration, the method comprises: identifying a new set of one or more URL patterns as a current set of offsets, wherein each of the one or more URL patterns is associated with a respective label that matches the label of interest; processing the URL patterns in the collection of URL patterns to generate an offset error for the current set of offsets; and determining whether or not the offset error for the current set of offsets is greater than an offset error for a best set of offsets, (i) and if so, performing a next iteration unless no new set of one or more URL patterns is identifiable, (ii) and otherwise, determining whether or not a current size of the domain filter satisfies the maximum size threshold and a current error rate for the domain filter satisfies the maximum false positive error rate threshold, (a) and if so, replacing values of the best set of offsets with values of the current set of offsets and performing the next iteration unless no new set of one or more URL patterns is identifiable, (b) and otherwise, performing the next iteration unless no new set of one or more URL patterns is identifiable; and upon determining that no new set of one or more URL patterns is identifiable, generating the domain filter for the label of interest using values of the best set of offsets; and filtering search results that are relevant to the query term with the domain filter to generate a plurality of filtered search results.