Recognise search type, query cache in search object; fix shard error reporting