More generic usage of advanced query