Search device, control method and recording medium of the retrieval device