Search problems at various scales involve a searcher, be it a molecule before reaction or a foraging animal, which performs an intermittent motion. Here we analyze a generic model based on such type of intermittent motion, in which the searcher alternates phases of slow motion allowing detection, and phases of fast motion without detection. We present full and systematic results for different modeling hypotheses of the detection mechanism in space dimension 1, 2 and 3. Our study completes and extends the results of our recent letter [Loverdo {it et al.} Nature Physics {bf 4}, 134 (2008)] and gives the necessary calculation details. In addition, a new modeling of the detection phase is presented. We show that the mean target detection time can be minimized as a function of the mean duration of each phase in dimension 1, 2 and 3. Importantly, this optimal strategy does not depend on the details of the modeling of the slow detection phase, which shows the robustness of our results. We believe that this systematic analysis can be used as a basis to study quantitatively various real search problems involving intermittent behaviors.