Bacterial chemotaxis to prominent microbiota metabolites such as indole is important in the formation of microbial communities in the gastrointestinal (GI) tract. However, the basis of chemotaxis to indole is poorly understood. Here, we exposed Escherichia coli to a range of indole concentrations and measured the dynamic responses of individual flagellar motors to determine the chemotaxis response. Below 1 mM indole, a repellent-only response was observed. At 1 mM indole and higher, a time-dependent inversion from a repellent to an attractant response was observed. The repellent and attractant responses were mediated by the Tsr and Tar chemoreceptors, respectively. Also, the flagellar motor itself mediated a repellent response independent of the receptors. Chemotaxis assays revealed that receptor-mediated adaptation to indole caused a bipartite response-wild-type cells were attracted to regions of high indole concentration if they had previously adapted to indole but were otherwise repelled. We propose that indole spatially segregates cells based on their state of adaptation to repel invaders while recruiting beneficial resident bacteria to growing microbial communities within the GI tract.