We find that there lacks a formal algebraic framework in the research area of P2P information retrieval. Such a formal framework is indispensable and pivotal. On the one hand, no solid theoretical foundation can explain why the results of many ad-hoc commercial ranking algorithms are good or bad; on the other hand, in some cases, it might be preferable in a decentralized search system to use different retrieval models and different ranking algorithms at the same time since each separate document collection and each peer might have different characteristics. Thus it is important to have a common framework, where we can capture the individual models and describe the overall behavior. Such a framework characterizes notions like ranking, relevance feedback, rank aggregation and combination, etc. and necessary operations. In this paper, we define such a foundation model for P2P information retrieval, where data models for rankings from the perspectives of both the end user's search needs and the search member server's contextual rankings are provided, and a new ranking aggregation language is proposed to perform ranking combination operations. A case study is included to demonstrate how the foundation model and the ranking aggregation language could be applied in real ranking problems of P2P Web search systems.