1. A method comprising: identifying, by one or more devices, documents relating to a query; generating, by the one or more devices, a plurality of substrings from the query; calculating, by the one or more devices and for a particular substring of the plurality of substrings, a value that corresponds to a comparison between the identified documents and the particular substring; determining, by the one or more devices, that the calculated value for the particular substring satisfies a particular threshold associated with identifying compounds; selecting, by the one or more devices and from two or more of the plurality of substrings, the particular substring as a semantic unit based on the calculated value for the particular substring satisfying the particular threshold; and obtaining, by the one or more devices, a refined list of documents by refining the identified documents based on the semantic unit.