Sync with new API for isValidQuery in alpinocorpus.