query-detection must be case-insensitive