Extract code from Query..add() and document Query.least_restrictive_keys()