The data-centric ad hoc sensor networks make efficient searching a crucial and challenging operation. Dynamic topology make flooding the most widely adopted solution at a cost of high bandwidth congestion leading to inefficient use of resources and low network lifetime. This paper presents IDEA, an efficient querying and searching technique for ad hoc sensor networks that reduces average energy consumption while maintaining the capacity and performance of the network. IDEA is based on iterative-deepening search which check-points the flooding of requests based on the results. This is further extended to a token-based approach called T-IDEA, which involves local decisions made by nodes to determine their participation in a virtual searching network. Results show that IDEA and T-IDEA significantly reduces the energy consumption compared to classical flooding approaches. Apart from that T-IDEA presents a highly distributed self-supervising topology formation which performs very well to increase the lifetime of the ad hoc sensor network.