Refactor to distinguish between result and query case-insensitivity.