1. A method performed by a server device, the method comprising: receiving, by the server device, information identifying documents selected in response to a search query; generating, by a processor of the server device, a plurality of substrings from the received search query, each of the plurality of substrings including at least two words; detecting, by the processor of the server device, an actual occurrence of one or more substrings, of the plurality of substrings, in one or more of the documents; calculating, by the processor of the server device, for each of the one or more substrings generated from the search query, a value that indicates a fraction of the documents in which an actual occurrence of the substring is detected; determining, by the processor of the server device, based on the calculated value for a particular substring of the one or more substrings, that the particular substring consists of words that form a single compound unit, the determining including: determining that the calculated value exceeds a threshold associated with compound units of words; and identifying, by the processor of the server device, a set of relevant documents based on determining that the particular substring forms the single compound unit.