Added search by sql using special key _sql in pattern.