Allow seach cache (debug off)

COrrect grouping for postgres sql