A key challenge in movement ecology is to understand how animals move in nature. Previous studies have predicted that animals should perform a special class of random walks, called Lévy walk, to obtain more targets. However, some empirical studies did not support this hypothesis, and the relationship between search strategy and ecological factors is still unclear. We focused on ecological factors, such as predation risk, and analyzed whether Lévy walk may not be favored. It was remarkable that the ecological factors often altered an optimal search strategy from Lévy walk to Brownian walk, depending on the speed of the predators movement, density of predators, etc. This occurred because higher target encounter rates simultaneously led searchers to higher predation risks. Our findings indicate that animals may not perform Lévy walks often, and we suggest that it is crucial to consider the ecological context for evaluating the search strategy performed by animals in the field. 