Added support for searching with secondary indexes